Opened 9 years ago

Last modified 21 months ago

#3238 new defect

Problem with Unicode in filename

Reported by: anonymous Owned by:
Priority: normal Component: SiteUploadPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11


Hi, I'm using the newest version of the plugin for a 0.10.4 Trac install. I suffered an unicode problem - which resulted in the following syslog entry:

Jun 24 09:51:20 projects Trac[main] ERROR: 'ascii' codec can't decode byte 0xc3 in position 9: ordinal not in range(128) Traceback (most recent call last):   File "/var/lib/python-support/python2.5/trac/web/", line 406,
 in dispatch_request     dispatcher.dispatch(req)   File "/var/lib/python-support/python2.5/trac/web/", line 237,
 in dispatch     resp = chosen_handler.process_request(req)   File "/usr/lib/python2.5/site-packages/TracWebAdmin-0.1.2dev_r5911-py2.5.egg/webadmin/", line 119,
 in process_request     path_info)   File "build/bdist.linux-i686/egg/siteupload/", line 70,
 in process_admin_request     self._render_view(req)   File "build/bdist.linux-i686/egg/siteupload/", line 83,
 in _render_view'site', f), f),   File "/var/lib/python-support/python2.5/trac/web/", line 158,
 in <lambda>     self._derived[name] = lambda *args, **kw: self(name, *args, **kw)   File "/var/lib/python-support/python2.5/trac/web/", line 143,
 in __call__     if arg != No

I was able to fix the problem with the attached patch.

Kind Regards, Achim

Attachments (1)

SiteUpload.diff (754 bytes) - added by A.Spangler@… 9 years ago.
Patch to solve Unicode error

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by A.Spangler@…

Patch to solve Unicode error

comment:1 Changed 7 years ago by olaf.meeuwissen@…

  • Trac Release changed from 0.10 to 0.11

Facing the same problem here where people would like to use Japanese filenames.

First off, the patch seems to be reversed. There is no to_unicode in 0.10.4. Nor in 0.11.1, 0.11.5 or 0.11.7.

Second, removing the offending file(s) from the environments htdocs directory makes the Admin section usable again.

Third, when attaching the same file to a wiki page, all is well. This led me to check what attaching does differently. Well, it stores the file in a URL-encoded name using unicode_quote() and unicode_unquote() to switch between (user-visible) filenames and (file-system) paths.

Considering how various file systems may mangle, munch and otherwise mutilate Unicode paths, I would say the plugin needs a fix, not Trac proper. For inspiration, see trac:browser:trunk/trac/

comment:2 Changed 21 months ago by rjollos

  • Owner pacopablo deleted

Add Comment

Modify Ticket

as new The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.