diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2018-08-16 15:53:59 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-16 15:53:59 -0400 |
| commit | fe480750c599b19b3b3c3318285f444c9d8dc1c8 (patch) | |
| tree | 4d2e4691c10f6bfc7193717aa2550f188f0236a0 /lib/extensions/output.py | |
| parent | e51587f58310de8dc7fd93ac54687df313225417 (diff) | |
| parent | f70fa25a1630b55f9568e7c8214e6d03536f978a (diff) | |
Merge pull request #260 from inkstitch/lexelby-windows-output-fix
fix output extension on windows
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) |
