From a2a15c5cd42379b346d8a13fbdff30f93b517b68 Mon Sep 17 00:00:00 2001 From: Matthew Fallshaw Date: Fri, 4 Oct 2019 17:48:24 -0700 Subject: [PATCH] fix crash on macOS when opening OpenSCAD Workbench The OpenSCAD Workbench crashes on open on macOS with error "a bytes-like object is required, not 'str'", due to python 2 to python 3 incompatibility. This is me implementing the fix described by oapa at https://forum.freecadweb.org/viewtopic.php?t=35384#p311908 (with an untested attempt to make it also still run with python 2). --- src/Mod/OpenSCAD/OpenSCADUtils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/OpenSCAD/OpenSCADUtils.py b/src/Mod/OpenSCAD/OpenSCADUtils.py index 0436512d77..50f73ad1b0 100644 --- a/src/Mod/OpenSCAD/OpenSCADUtils.py +++ b/src/Mod/OpenSCAD/OpenSCADUtils.py @@ -77,7 +77,7 @@ def searchforopenscadexe(): stdout=subprocess.PIPE,stderr=subprocess.PIPE) stdout,stderr = p1.communicate(ascript) if p1.returncode == 0: - opathl=stdout.split('\n') + opathl = stdout.decode().split('\n') if sys.version_info.major >= 3 else stdout.split('\n') if len(opathl) >=1: return opathl[0]+'Contents/MacOS/OpenSCAD' #test the default path