## page was renamed from MoinMoinBugs/PngImageUploadGivesUnicodeError = Description = When I try to attach a png image (not tested with other formats), I get a Unicode error. The bug ist probably related to my configuration, as a test shows that one image that exposes the bug on my server works here. == Steps to reproduce == ## Describe the steps needed to reproduce the bug. If we can't reproduce it, we probably can't fix it. 1. Use the pseudo {{{inline:}}} scheme 2. In the upload dialog, select a PNG image and hit "Upload". == Example == ##Add URL that show the bug, screenshot or test wiki markup that fail... {{attachment:testimage.png}} ##URL: ##attachment:screenshot.png ##{{{ ##Example wiki markup that fail ##}}} {{{inline:testimage.png}}} == Details == ## If you got a traceback, please save the traceback page as html and attach here: [[attachment:traceback.html]] ## if the bug is in this wiki, just kill the table and write: This Wiki. ## If a traceback is not available, please fill in the details here: || '''1.5.0rc1 (patch-434)''' || || || '''win32 (nt) (xp sp2)''' || || || '''Python 2.3.4''' || || || '''Apache/2.0.54''' || || || '''Apache/2.0.54 (Win32) mod_python/3.1.3 Python/2.3.4 Server at localhost Port 80''' || || Possibly interesting detail: if I don't enable locales in site.py, I can't get mod_py to work. I.e. my {{site.py}}} looks like this (around line 340): {{{#!python encoding = "ascii" # Default value set by _PyUnicode_Init() if 1: # ^^^^ changed from 0 (default) to 1 # Enable to support locale aware default string encodings. import locale loc = locale.getdefaultlocale() if loc[1]: encoding = loc[1] }}} Result: {{{#!python >>> print site.encoding cp1252 }}} == Workaround == ## How to deal with the bug until it is fixed = Discussion = Please try again with the patch from MoinMoinBugs/AttachmentsDontWork and report whether it fixed this one, too. Thanks for the tip - but unfortunately the patch doesn't help. (I had to transfer my wiki from a 2.4 installation back to a 2.3.5 install, and the error popped right back up. Moin is now at 1.5.2 (installed), which has the patch installed. -- 2006-03-09, ueli Does it work if you use instead of `inline` the `attachment` scheme? -- ReimarBauer <> No, it doesn't - same error. Another hint: I tried using CGI instead of mod_python (because the patch only affects RequestCGI and doesn't do anything for mod_python). There, it works (but preformance does drop noticeably, too...) -- 2006-03-22, Ueli Try the attached patch: [[attachment:fix_upload_attach.patch]] -- NickPhillips * this patch has been put into 1.5 branch a while ago. -- ThomasWaldmann <> Oops, wrong bug. This one looks like it is the same bug as MoinMoinBugs/ModPyDoesNotAcceptFileUpload. = Plan = ## This part is for Moin``Moin developers: * Priority: * Assigned to: * Status: duplicate of MoinMoinBugs/ModPyDoesNotAcceptFileUpload. ---- ## If you are a moin core developer, replace the category to Category* in these cases: ## Category MoinMoinNoBug - if this is not a bug. ## Category MoinMoinBugConfirmed - if you can confirm the bug on current code. ## Category MoinMoinBugFixed - after the bug is fixed in current code. CategoryMoinMoinNoBug