From 779bebc6d22efcd2f72ac355e4cc3f1c029a8603 Mon Sep 17 00:00:00 2001 From: Bernd Kolb Date: Fri, 14 Jun 2019 22:28:37 +0200 Subject: [PATCH] Make InkStitch run in Inkscape 1.0 alpha I downloaded inkscape 1.0 alpha for MacOS from the inkscape build server and installed inkstitch. For me it seems to run with python 3. Thus I am getting error messages like `TypeError: write() argument must be str, not bytes` which are fixed by this commit. --- stub.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stub.py b/stub.py index 7c9975244..c7ff5fa54 100644 --- a/stub.py +++ b/stub.py @@ -48,12 +48,12 @@ if sys.platform == "win32": import msvcrt msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) -sys.stdout.write(stdout) +sys.stdout.write(stdout.decode(sys.stdout.encoding)) sys.stdout.flush() stderr = stderr.strip() if stderr: - sys.stderr.write(stderr.strip()) + sys.stderr.write(stderr.decode(sys.stdout.encoding).strip()) sys.stderr.flush() sys.exit(extension.returncode)