Code

Opened 4 years ago

Closed 4 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:

Description

Uploading a file with ÆÅØ fails.

Attachments (1)

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

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by oyvind

Fix, but probably not the right way

comment:1 Changed 4 years ago by oyvind

  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement set

comment:2 Changed 4 years ago by Alex

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 4 years ago by kmtracey

  • Resolution set to invalid
  • Status changed from new to closed

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: http://code.djangoproject.com/wiki/ExpectedTestFailures

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: http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#if-you-get-a-unicodeencodeerror

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


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

 
Note: See TracTickets for help on using tickets.