Opened 16 years ago

Closed 4 years ago

#3238 closed defect (duplicate)

Problem with Unicode in filename

Reported by: anonymous Owned by:
Priority: normal Component: SiteUploadPlugin
Severity: normal Keywords: patch
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@… 16 years ago.
Patch to solve Unicode error

Download all attachments as: .zip

Change History (5)

Changed 16 years ago by A.Spangler@…

Attachment: SiteUpload.diff added

Patch to solve Unicode error

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

Trac Release: 0.100.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 9 years ago by Ryan J Ollos

Owner: John Hampton deleted

comment:3 Changed 4 years ago by figaro

Keywords: patch added

Possibly identical to #7436.

comment:4 Changed 4 years ago by Ryan J Ollos

Resolution: duplicate
Status: newclosed

Looks the same. Closing this one because the report in #7436 is better and more current.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

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

Note: See TracTickets for help on using tickets.