From 8f6652dbef562a5b0f865085941d5a5095d8babc Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Thu, 2 Aug 2018 22:05:42 -0400 Subject: [PATCH] set stdout to binary mode on windows --- lib/extensions/output.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/extensions/output.py b/lib/extensions/output.py index 1dc8d19d5..e72eac7bd 100644 --- a/lib/extensions/output.py +++ b/lib/extensions/output.py @@ -36,6 +36,10 @@ 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: