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
parent
01f90de9c2
commit
e5907ad380
|
@ -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(
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in New Issue