changeset 58:ea839127934d

Avoid creating another file descriptor for the merged output file
author Björn Ricks <bjoern.ricks@intevation.de>
date Wed, 12 Nov 2014 12:21:09 +0100
parents 423f99732a80
children 2dacbe7fb7f9
files odfcast/convert.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/odfcast/convert.py	Wed Nov 12 12:20:01 2014 +0100
+++ b/odfcast/convert.py	Wed Nov 12 12:21:09 2014 +0100
@@ -193,9 +193,10 @@
 
         outfile = tempfile.NamedTemporaryFile()
 
-        merger.write(outfile.name)
+        merger.write(outfile)
+        merger.close()
+        outfile.seek(0)
 
-        merger.close()
         log.debug("PDF documents merged")
         return Response(outfile, mimetype=PDF_MIMETYPE)
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)