#9696: FileField raises unhandled exception when filename contains non-ascii
characters
-------------------------------------------+--------------------------------
Reporter: magarac | Owner: kmtracey
Status: closed | Milestone: 1.1
Component: File uploads/storage | Version: 1.0
Resolution: invalid | Keywords:
Stage: Accepted | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
-------------------------------------------+--------------------------------
Changes (by kmtracey):
* status: new => closed
* resolution: => invalid
Comment:
OK, this is not in fact like #9579. os.stat accepts unicode paths just
fine, so long as the LANG environment variable is set correctly. When it
is not, for example if it set to "C", things like
os.getfilesystemencoding() return odd values like 'ANSI_X3.4-1968', which
is apparently a fancy way to spell 'ASCII', and os.stat runs into trouble
attempting to encode the unicode path value into the supposed preferred fs
encoding. The correct fix is to ensure that LANG is set properly.
Unfortunately LANG is often set incorrectly when running under Apache.
Documenting the need to set LANG properly under Apache is the subject of
#10426, so it doesn't need this ticket as well to track it.
[Also, the stripping of unicode chars from file names is covered by
#10254. Not sure why the reporters of this problem don't see that, but I
had to modify get_valid_filename as mentioned in a comment on that ticket
(and run under Apache where the LANG setting was wrong) to even recreate
this error. But that other issue I noticed is also covered by another
ticket.]
So, since ultimately the exception here is due to a config error, and
there's already another ticket to cover documenting the config
requirements better, I'm closing this one as invalid.
--
Ticket URL: <http://code.djangoproject.com/ticket/9696#comment:10>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---