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

  1. Use the pseudo inline: scheme

  2. In the upload dialog, select a PNG image and hit "Upload".

Example

testimage.png

inline:testimage.png

Details

traceback.html

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):

   1 encoding = "ascii" # Default value set by _PyUnicode_Init()
   2 
   3 if 1:
   4 # ^^^^ changed from 0 (default) to 1
   5     # Enable to support locale aware default string encodings.
   6     import locale
   7     loc = locale.getdefaultlocale()
   8     if loc[1]:
   9         encoding = loc[1]

Result:

   1 >>> print site.encoding
   2 cp1252

Workaround

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 2006-03-20 21:06:13

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: fix_upload_attach.patch -- NickPhillips

Oops, wrong bug. This one looks like it is the same bug as MoinMoinBugs/ModPyDoesNotAcceptFileUpload.

Plan


CategoryMoinMoinNoBug

MoinMoin: MoinMoinBugs/ModPyPngImageUploadGivesUnicodeError (last edited 2008-03-18 17:21:44 by p5B055566)