#19367: ContentFile fails to save with filesystem storage when initialized with
unicode string
--------------------------------------+--------------------
     Reporter:  void                  |      Owner:  nobody
         Type:  Bug                   |     Status:  new
    Component:  File uploads/storage  |    Version:  master
     Severity:  Normal                |   Keywords:
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+--------------------
 Attached test fails for me on python 2.7 with the following traceback:

 {{{
 Traceback (most recent call last):
   File "/Users/voidus/Documents/workspace/django-
 trunk/tests/regressiontests/file_storage/tests.py", line 590, in
 test_content_saving
     self.storage.save('unicode.txt', ContentFile("espaƱol"))
   File "/Users/voidus/Documents/workspace/django-
 trunk/django/core/files/storage.py", line 48, in save
     name = self._save(name, content)
   File "/Users/voidus/Documents/workspace/django-
 trunk/django/core/files/storage.py", line 206, in _save
     _file.write(chunk)
 UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in
 position 4: ordinal not in range(128)

 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19367>
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 https://groups.google.com/groups/opt_out.


Reply via email to