c7protal  committed 838f5dc

Fixed one failure and 7 errors as described here:

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

  • Participants
  • Parent commits f436f0c
  • Branches default

Comments (0)

Files changed (1)

File django/core/files/

 Classes representing uploaded files.
-import sys
+import sys, os
 if sys.version_info >= (3,0):
     from io import BytesIO as StringIO
 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',
     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):