summaryrefslogtreecommitdiff
path: root/django/core/files/uploadhandler.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/core/files/uploadhandler.py')
-rw-r--r--django/core/files/uploadhandler.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/django/core/files/uploadhandler.py b/django/core/files/uploadhandler.py
index 4316fddf43..88f78904bb 100644
--- a/django/core/files/uploadhandler.py
+++ b/django/core/files/uploadhandler.py
@@ -2,10 +2,7 @@
Base file upload handler classes, and the built-in concrete subclasses
"""
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
+from io import BytesIO
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
@@ -161,12 +158,12 @@ class MemoryFileUploadHandler(FileUploadHandler):
def new_file(self, *args, **kwargs):
super(MemoryFileUploadHandler, self).new_file(*args, **kwargs)
if self.activated:
- self.file = StringIO()
+ self.file = BytesIO()
raise StopFutureHandlers()
def receive_data_chunk(self, raw_data, start):
"""
- Add the data to the StringIO file.
+ Add the data to the BytesIO file.
"""
if self.activated:
self.file.write(raw_data)