Fix jinja2 dump in temporary file for Windows

tempfile.NamedTemporaryFile() creates **and opens** the file.
jinja2.stream().dump() will try to open the file too, if given a str
(filename). This does not cause issue on Linux, but on Windows the same
file cannot be open twice at the same time...

The solution was to pass a file pointer to 'dump()' instead of the
filename, so jinja2 does not need to open it again.
master
Niels Giorno 2020-08-28 12:53:46 +02:00
parent 01f90de9c2
commit e5907ad380
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ def generate_outfile(
) )
import subprocess import subprocess
jj2_tpl.stream(context).dump( tmpsvg.name ) jj2_tpl.stream(context).dump( tmpsvg )
inkscape_process = subprocess.Popen( inkscape_process = subprocess.Popen(
[ [