diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-08-17 16:08:02 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-08-17 16:08:02 -0400 |
| commit | 72b8c367db613c3f44bce1174a8a5e8226bd2863 (patch) | |
| tree | 0daf0758b275a2eb4d794c202dc8d2c0e17749eb /lib/extensions/output.py | |
| parent | ef17511c66a9f59bb9c74cb6f94f71e044c4fef1 (diff) | |
| parent | d7fddb0c946e19c571325a88ae5516bcbd0df128 (diff) | |
Merge remote-tracking branch 'origin/master' into lexelby-auto-fill-run
Diffstat (limited to 'lib/extensions/output.py')
| -rw-r--r-- | lib/extensions/output.py | 7 |
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) |
