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:
Roberto Rosario
2017-08-29 02:09:49 -04:00
parent 83491dd7e1
commit 9dba40a1d8
3 changed files with 7 additions and 19 deletions

View File

@@ -4,11 +4,6 @@ import io
import logging
import os
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from PIL import Image
import PyPDF2
import sh
@@ -66,7 +61,7 @@ logger = logging.getLogger(__name__)
class IteratorIO(object):
def __init__(self, iterator):
self.file_buffer = StringIO()
self.file_buffer = io.BytesIO()
for chunk in iterator:
self.file_buffer.write(chunk)