Commits

c7protal  committed 838f5dc

Fixed one failure and 7 errors as described here: http://bitbucket.org/fiji/django-3k/issue/92

from FAILED (failures=333, errors=153)
to FAILED (failures=332, errors=146)

  • Participants
  • Parent commits f436f0c

Comments (0)

Files changed (1)

File django/core/files/uploadedfile.py

 Classes representing uploaded files.
 """
 
-import sys
+import sys, os
 if sys.version_info >= (3,0):
     from io import BytesIO as StringIO
 else:
 from django.core.files.base import File
 from django.core.files import temp as tempfile
 from django.utils.encoding import smart_str
+from django.utils.py3 import to_utf8_bytes
 
 __all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryUploadedFile',
            'SimpleUploadedFile')
     """
     def __init__(self, name, content, content_type='text/plain'):
         content = content or ''
-        super(SimpleUploadedFile, self).__init__(StringIO(content), None, name,
+        super(SimpleUploadedFile, self).__init__(StringIO(to_utf8_bytes(content)), None, name,
                                                  content_type, len(content), None)
 
     def from_dict(cls, file_dict):