#17816: UnicodeEncodeError in Image- and FileFields
-------------------------------------+-------------------------------------
     Reporter:  andi@…               |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |                  Version:  1.3
    Component:  Forms                |               Resolution:
     Severity:  Normal               |             Triage Stage:
     Keywords:                       |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by akaariai):

 * cc: anssi.kaariainen@… (added)


Comment:

 Isn't this the nice "you must set your locale correctly for your web-
 server user" error. Something like this:
 http://stackoverflow.com/questions/6171278/unicode-in-django-admin. If you
 Google for this there are lot more similar errors to be found.

 I, too, was hit with this issue some time ago. I have two suggestions:
   - Issue a warning when Django is ran in non-UTF8 environment. Granted,
 this will be hidden in the log files, but still gives developers a chance
 to fix this before bug-reports from production. This is one of those bugs
 which are hard to spot in testing...
   - When the unicode error happens in file saving, convert it to a more
 explanatory one. Link to documentation explaining this issue if possible.

 You could also issue an warning always when a file save operation gets an
 unicode string and the server is not in UTF-8 locale setting, even if
 there isn't any actual error.

 Of course, adding more warnings about this in the documentation is one way
 forward, too.

 I am not too sure if the optional conversion is a good solution. The
 problem here is that you will still get the error in production. You will
 not remember to check that option _before_ you are hit with this, and
 having it default to on is not going to work. If there are enough users
 who want that option then why not, but it will not magically solve this
 problem.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17816#comment:6>
Django <https://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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to