diff options
Diffstat (limited to 'django/core/files/base.py')
-rw-r--r-- | django/core/files/base.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/django/core/files/base.py b/django/core/files/base.py index c1c9199cb5..0c6109f1b4 100644 --- a/django/core/files/base.py +++ b/django/core/files/base.py @@ -3,10 +3,11 @@ from __future__ import unicode_literals import os from io import BytesIO, StringIO, UnsupportedOperation -from django.utils.encoding import smart_text from django.core.files.utils import FileProxyMixin from django.utils import six -from django.utils.encoding import force_bytes, python_2_unicode_compatible +from django.utils.encoding import ( + force_bytes, force_str, python_2_unicode_compatible, smart_text, +) @python_2_unicode_compatible @@ -25,7 +26,7 @@ class File(FileProxyMixin): return smart_text(self.name or '') def __repr__(self): - return "<%s: %s>" % (self.__class__.__name__, self or "None") + return force_str("<%s: %s>" % (self.__class__.__name__, self or "None")) def __bool__(self): return bool(self.name) |