Use BytesIO instead of StringIO. Use text_type instead of unicode.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from io import BytesIO
|
||||
import zipfile
|
||||
|
||||
try:
|
||||
@@ -8,11 +9,6 @@ try:
|
||||
except:
|
||||
COMPRESSION = zipfile.ZIP_STORED
|
||||
|
||||
try:
|
||||
from cStringIO import StringIO
|
||||
except ImportError:
|
||||
from StringIO import StringIO
|
||||
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
|
||||
|
||||
@@ -35,7 +31,7 @@ class CompressedFile(object):
|
||||
self._create()
|
||||
|
||||
def _create(self):
|
||||
self.descriptor = StringIO()
|
||||
self.descriptor = BytesIO()
|
||||
self.zf = zipfile.ZipFile(self.descriptor, mode='w')
|
||||
|
||||
def _open(self, file_input):
|
||||
|
||||
Reference in New Issue
Block a user