Edgewall Software
Modify

Opened 18 years ago

Closed 17 years ago

#2981 closed defect (worksforme)

unable to upload files which filename is non-english characters

Reported by: anonymous Owned by: Christian Boos
Priority: normal Milestone:
Component: general Version: devel
Severity: normal Keywords: attachment unicode windows
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

With 0.10dev, while attaching a filename in asian-characters. Attachment function is broken. for example, 中文.txt became %E4%B8%AD%E6%96%87.txt and attachment link were unable to locate this file.

Attachments (0)

Change History (12)

comment:1 by Christian Boos, 18 years ago

Keywords: attachment unicode added
Milestone: 0.10
Owner: changed from Jonas Borgström to Christian Boos

While trying out with european accented characters on Windows, I also had some issues, but different ones. I've fixed them in r3103.

Can you test if this works for asian characters too?

comment:2 by anonymous, 18 years ago

Resolution: fixed
Status: newclosed

thanks, r3103 is now working with asian filenames.

comment:3 by bitneer@…, 18 years ago

Keywords: windows added
Resolution: fixed
Status: closedreopened

attachement problem

  • Trac 0.10dev(revision 3416) on Windows XP
  • korean filename: example) 한글.txt

error message

Traceback (most recent call last):
  File "C:\Python23\Lib\site-packages\trac\web\main.py", line 314, in dispatch_request
    dispatcher.dispatch(req)
  File "C:\Python23\Lib\site-packages\trac\web\main.py", line 163, in dispatch
    if not req.path_info or req.path_info == '/':
  File "C:\Python23\Lib\site-packages\trac\web\api.py", line 193, in <lambda>
    path_info = property(fget=lambda self: self.environ.get('PATH_INFO', '').decode('utf-8'),
UnicodeDecodeError: 'utf8' codec can't decode byte 0xa2 in position 31: unexpected code byte

comment:4 by Matthew Good, 18 years ago

The byte 0xa2 is not in the example filename you mentioned. I've tested the example filename on different Trac setups and it works fine. I also tested a filename with the character for 0xa2 "¢", which works fine as well. What web server are you using, and which Trac frontend (FastCGI, mod_python, CGI)? It looks like it must be encoding the PATH_INFO variable incorrectly.

comment:5 by bitneer@…, 18 years ago

I'm using

  • Apache 2.0.58 for Windows
  • CGI for Trac frontend

comment:6 by Matthew Good, 18 years ago

Milestone: 0.100.11

I can't reproduce this with the current information. Postponing until after the 0.10 release. This could get bumped up to 0.10.1 once we have that milestone.

comment:7 by Christian Boos, 18 years ago

Milestone: 0.11
Resolution: duplicate
Status: reopenedclosed

I think it's the same issue as #3663.

comment:8 by Blackhex, 17 years ago

Resolution: duplicate
Status: closedreopened

I think that problem is in getting filename of uploaded file from request. I'm trying to upload files within ScreenshotsPlugin using this:

file = req.args['file']
filename = file.filename

The filename object is then of type str and should be of type unicode, should't it?

in reply to:  8 ; comment:9 by Emmanuel Blot, 17 years ago

Replying to Blackhex:

I think that problem is in getting filename of uploaded file from request. I'm trying to upload files within ScreenshotsPlugin using this:

Which file/version are you refering to?

comment:10 by Noah Kantrowitz, 17 years ago

I traced the error to trac.web.api.Request._parse_args, and it affects both 0.10-stable and trunk. In short, non-file arguments (i.e. most of them) are decoded as UTF8 text there, but filenames are left alone. These should be decoded as well.

in reply to:  9 comment:11 by anonymous, 17 years ago

Replying to eblot:

Which file/version are you refering to?

I'm working with 0.10.3 but coderanger said me that code handling argskey.filename is not changed in trunk since 0.10.3.

comment:12 by Emmanuel Blot, 17 years ago

Resolution: worksforme
Status: reopenedclosed

I can't reproduce this issue with the latest trunk, using tracd on a Mac OS 10.4.10. I tried with the same machine as the client (OmniWeb/WebKit), as well as with a virtualized Linux/Ubuntu 7.04 (Firefox 2.0.0.3), using the proposed korean 한글.txt and chinese(?) 中文.txt filenames.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.