From 54009f14ee580912e8b098db293250aa1840b497 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 13 Mar 2023 13:37:36 +0100 Subject: [PATCH] App: fixes #7833: Python2/3 FIXME code in App/FreeCADInit.py to be reviewed The workaround was needed for Py2 on Windows. Since with Py3 it works as expected the workaround can be removed --- src/App/FreeCADInit.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/App/FreeCADInit.py b/src/App/FreeCADInit.py index e00275344a..9670c56db7 100644 --- a/src/App/FreeCADInit.py +++ b/src/App/FreeCADInit.py @@ -63,16 +63,6 @@ def setupSearchPaths(PathExtension): # new paths must be prepended to avoid to load a wrong version of a library try: os.environ["PATH"] = PathEnvironment + os.environ["PATH"] - except UnicodeDecodeError: - # See #0002238. FIXME: check again once ported to Python 3.x - Log('UnicodeDecodeError was raised when concatenating unicode string with PATH. Try to remove non-ascii paths...\n') - path = os.environ["PATH"].split(os.pathsep) - cleanpath=[] - for i in path: - if test_ascii(i): - cleanpath.append(i) - os.environ["PATH"] = PathEnvironment + os.pathsep.join(cleanpath) - Log('done\n') except UnicodeEncodeError: Log('UnicodeEncodeError was raised when concatenating unicode string with PATH. Try to replace non-ascii chars...\n') os.environ["PATH"] = PathEnvironment.encode(errors='replace') + os.environ["PATH"] @@ -305,7 +295,6 @@ Wrn = FreeCAD.Console.PrintWarning Crt = FreeCAD.Console.PrintCritical Ntf = FreeCAD.Console.PrintNotification Tnf = FreeCAD.Console.PrintTranslatedNotification -test_ascii = lambda s: all(ord(c) < 128 for c in s) #store the cmake variales App.__cmake__ = cmake; @@ -962,6 +951,5 @@ App.ReturnType = ReturnType # clean up namespace del(InitApplications) -del(test_ascii) Log ('Init: App::FreeCADInit.py done\n')