summaryrefslogtreecommitdiff
path: root/django/core/files
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-06-07 18:08:47 +0200
committerClaude Paroz <claude@2xlibre.net>2012-06-07 18:08:47 +0200
commit4a103086d5c67fa4fcc53c106c9fdf644c742dd8 (patch)
tree3df00600c27f6369f7561c3b8ddf2f97d2d341d9 /django/core/files
parent706fd9adc0b6587c7f96a834c757708e64fcf615 (diff)
Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.
Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
Diffstat (limited to 'django/core/files')
-rw-r--r--django/core/files/base.py4
-rw-r--r--django/core/files/uploadhandler.py6
2 files changed, 7 insertions, 3 deletions
diff --git a/django/core/files/base.py b/django/core/files/base.py
index a2d703c963..04853fad0c 100644
--- a/django/core/files/base.py
+++ b/django/core/files/base.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
import os
from io import BytesIO
@@ -19,7 +21,7 @@ class File(FileProxyMixin):
return smart_str(self.name or '')
def __unicode__(self):
- return smart_unicode(self.name or u'')
+ return smart_unicode(self.name or '')
def __repr__(self):
return "<%s: %s>" % (self.__class__.__name__, self or "None")
diff --git a/django/core/files/uploadhandler.py b/django/core/files/uploadhandler.py
index 88f78904bb..68d540e595 100644
--- a/django/core/files/uploadhandler.py
+++ b/django/core/files/uploadhandler.py
@@ -2,6 +2,8 @@
Base file upload handler classes, and the built-in concrete subclasses
"""
+from __future__ import unicode_literals
+
from io import BytesIO
from django.conf import settings
@@ -33,9 +35,9 @@ class StopUpload(UploadFileException):
def __unicode__(self):
if self.connection_reset:
- return u'StopUpload: Halt current upload.'
+ return 'StopUpload: Halt current upload.'
else:
- return u'StopUpload: Consume request data, then halt.'
+ return 'StopUpload: Consume request data, then halt.'
class SkipFile(UploadFileException):
"""