summaryrefslogtreecommitdiff
path: root/lib/extensions/output.py
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2018-08-17 16:19:46 -0400
committerLex Neva <github.com@lexneva.name>2018-08-17 16:19:46 -0400
commit0e4c3a3f1b76c1b655ec2788017335e87eff29da (patch)
tree2075fc0292038b4a2e92fc018b503805cf30fdec /lib/extensions/output.py
parent19bb8a5a6dbe4244a590147187949d0555eb9fbc (diff)
parentece81d0c91c8b96f7da2c0339f6807a47d57112e (diff)
Merge remote-tracking branch 'origin/master' into lexelby-no-embroider-command
Diffstat (limited to 'lib/extensions/output.py')
-rw-r--r--lib/extensions/output.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/extensions/output.py b/lib/extensions/output.py
index 1dc8d19d..f3bb0a80 100644
--- a/lib/extensions/output.py
+++ b/lib/extensions/output.py
@@ -36,10 +36,15 @@ class Output(InkstitchExtension):
write_embroidery_file(temp_file.name, stitch_plan, self.document.getroot())
+ if sys.platform == "win32":
+ import msvcrt
+ msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
+
# inkscape will read the file contents from stdout and copy
# to the destination file that the user chose
- with open(temp_file.name) as output_file:
+ with open(temp_file.name, "rb") as output_file:
sys.stdout.write(output_file.read())
+ sys.stdout.flush()
# clean up the temp file
os.remove(temp_file.name)