Opened 8 years ago

Closed 8 years ago

#13550 closed (invalid)

Saving files with non ascii chars fails

Reported by: oyvind Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords: ascii unicode storage
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: yes
Easy pickings: UI/UX:


Uploading a file with ÆÅØ fails.

Attachments (1)

non_ascii_chars_fix.diff (1.8 KB) - added by oyvind 8 years ago.
Fix, but probably not the right way

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by oyvind

Attachment: non_ascii_chars_fix.diff added

Fix, but probably not the right way

comment:1 Changed 8 years ago by oyvind

Needs tests: set
Patch needs improvement: set

comment:2 Changed 8 years ago by Alex Gaynor

This doesn't look correct. There are tests for uploading files with unicode chars, and indeed the Python os APISs support taking unicode and automatically encode it to sys.getfilesystemencoding().

comment:3 Changed 8 years ago by Karen Tracey

Resolution: invalid
Status: newclosed

We do have a test of uploading files with non-ASCII data in their names. In fact that has caused a bit of a problem because not all buildbots have been set up properly to support this. See:

Converting to bytestrings within Django is not right because Django does not know the right encoding to use. Forcing utf-8 corrupts the file names on some systems (Windows) that do not use utf-8 encoding. The right answer is to correctly set the locale for the running server so that unicode strings can be successfully passed through to the os routines. See for example:

Note: See TracTickets for help on using tickets.
Back to Top