Loading django/core/files/base.py +2 −2 Original line number Diff line number Diff line import os from io import BytesIO, StringIO from io import BytesIO from django.utils.encoding import smart_str, smart_unicode from django.core.files.utils import FileProxyMixin Loading Loading @@ -126,7 +126,7 @@ class ContentFile(File): """ def __init__(self, content, name=None): content = content or '' super(ContentFile, self).__init__(StringIO(content), name=name) super(ContentFile, self).__init__(BytesIO(content), name=name) self.size = len(content) def __str__(self): Loading Loading
django/core/files/base.py +2 −2 Original line number Diff line number Diff line import os from io import BytesIO, StringIO from io import BytesIO from django.utils.encoding import smart_str, smart_unicode from django.core.files.utils import FileProxyMixin Loading Loading @@ -126,7 +126,7 @@ class ContentFile(File): """ def __init__(self, content, name=None): content = content or '' super(ContentFile, self).__init__(StringIO(content), name=name) super(ContentFile, self).__init__(BytesIO(content), name=name) self.size = len(content) def __str__(self): Loading