X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/b2d342589a7889a3b096e7192453d53bd28eed7d..159b148e9d37274930d6c0f76c365d333f16fd87:/src/reporting/utils.py?ds=inline diff --git a/src/reporting/utils.py b/src/reporting/utils.py index f5d4c3342..955f7d92d 100755 --- a/src/reporting/utils.py +++ b/src/reporting/utils.py @@ -22,7 +22,7 @@ def render_to_pdf(output_path, template, context=None, add_files=None): :param dict add_files: a dictionary of additional files XeTeX will need """ - from StringIO import StringIO + from io import BytesIO import shutil from tempfile import mkdtemp import subprocess @@ -30,7 +30,7 @@ def render_to_pdf(output_path, template, context=None, add_files=None): from django.template.loader import render_to_string rendered = render_to_string(template, context) - texml = StringIO(rendered.encode('utf-8')) + texml = BytesIO(rendered.encode('utf-8')) tempdir = mkdtemp(prefix="render_to_pdf-") tex_path = os.path.join(tempdir, "doc.tex") with open(tex_path, 'w') as tex_file: