open in binary mode when saving files to archive

This commit is contained in:
Thomas Steen Rasmussen 2016-05-30 18:39:05 +02:00
parent 349cc325d7
commit a4dd75e5c8

View file

@ -39,7 +39,7 @@ def generate_pdf_letter(filename, template, formatdict):
finalpdf.addPage(page)
### save the generated pdf to the archive
with open(settings.PDF_ARCHIVE_PATH+filename, 'w') as fh:
with open(settings.PDF_ARCHIVE_PATH+filename, 'wb') as fh:
finalpdf.write(fh)
print('Saved pdf to archive: %s' % settings.PDF_ARCHIVE_PATH+filename)