diff --git a/src/Mod/Path/PathScripts/PathJobCmd.py b/src/Mod/Path/PathScripts/PathJobCmd.py index 7158671f8d..ca8237d80e 100644 --- a/src/Mod/Path/PathScripts/PathJobCmd.py +++ b/src/Mod/Path/PathScripts/PathJobCmd.py @@ -164,7 +164,7 @@ class CommandJobTemplateExport: encoded = job.Proxy.setupSheet.encodeTemplateAttributes(attrs) # write template - with open(PathUtil.toUnicode(path), 'wb') as fp: + with open(PathUtil.toUnicode(path), 'w') as fp: json.dump(encoded, fp, sort_keys=True, indent=2) if FreeCAD.GuiUp: diff --git a/src/Mod/Path/PathScripts/PathToolLibraryManager.py b/src/Mod/Path/PathScripts/PathToolLibraryManager.py index 1ffaf1e5a7..ebcb5121f2 100644 --- a/src/Mod/Path/PathScripts/PathToolLibraryManager.py +++ b/src/Mod/Path/PathScripts/PathToolLibraryManager.py @@ -299,7 +299,7 @@ class ToolLibraryManager(): fext = os.path.splitext(name)[1].lower() if fext != ext: name = "{}{}".format(name, ext) - return (open(PathUtil.toUnicode(name), 'wb'), name) + return (open(PathUtil.toUnicode(name), 'w'), name) if filename[1] == self.TooltableTypeXML: fp,fname = openFileWithExtension(filename[0], '.xml') diff --git a/src/Mod/Path/PathScripts/post/centroid_post.py b/src/Mod/Path/PathScripts/post/centroid_post.py index 42e7f81a7f..3ea3a7ec84 100644 --- a/src/Mod/Path/PathScripts/post/centroid_post.py +++ b/src/Mod/Path/PathScripts/post/centroid_post.py @@ -227,7 +227,7 @@ def export(objectslist, filename, argstring): print("done postprocessing.") if not filename == '-': - gfile = pythonopen(filename, "wb") + gfile = pythonopen(filename, "w") gfile.write(final) gfile.close() diff --git a/src/Mod/Path/PathScripts/post/comparams_post.py b/src/Mod/Path/PathScripts/post/comparams_post.py index 7662227051..b8a5fd6b27 100644 --- a/src/Mod/Path/PathScripts/post/comparams_post.py +++ b/src/Mod/Path/PathScripts/post/comparams_post.py @@ -95,7 +95,7 @@ def export(obj,filename,argstring): gcode+= lineout(c, oldvals, modal)+'\n' oldvals = saveVals(c) gcode+='M2\n' - gfile = open(filename,"wb") + gfile = open(filename,"w") gfile.write(gcode) gfile.close() else: diff --git a/src/Mod/Path/PathScripts/post/dynapath_post.py b/src/Mod/Path/PathScripts/post/dynapath_post.py index 6be0a3e832..1ce1deb768 100644 --- a/src/Mod/Path/PathScripts/post/dynapath_post.py +++ b/src/Mod/Path/PathScripts/post/dynapath_post.py @@ -179,7 +179,7 @@ def export(objectslist,filename,argstring): print("done postprocessing.") - gfile = pythonopen(filename,"wb") + gfile = pythonopen(filename,"w") gfile.write(final) gfile.close() diff --git a/src/Mod/Path/PathScripts/post/example_post.py b/src/Mod/Path/PathScripts/post/example_post.py index 50d95f1c73..4807b56e68 100644 --- a/src/Mod/Path/PathScripts/post/example_post.py +++ b/src/Mod/Path/PathScripts/post/example_post.py @@ -49,7 +49,7 @@ def export(objectslist, filename,argstring): print("the given object is not a path") gcode = obj.Path.toGCode() gcode = parse(gcode) - gfile = pythonopen(filename, "wb") + gfile = pythonopen(filename, "w") gfile.write(gcode) gfile.close() diff --git a/src/Mod/Path/PathScripts/post/fablin_post.py b/src/Mod/Path/PathScripts/post/fablin_post.py index c2ee8ca9ed..ac06969344 100644 --- a/src/Mod/Path/PathScripts/post/fablin_post.py +++ b/src/Mod/Path/PathScripts/post/fablin_post.py @@ -197,7 +197,7 @@ def export(objectslist,filename,argstring): print ("done postprocessing.") - gfile = pythonopen(filename,"wb") + gfile = pythonopen(filename,"w") gfile.write(gcode) gfile.close() diff --git a/src/Mod/Path/PathScripts/post/grbl_G81_post.py b/src/Mod/Path/PathScripts/post/grbl_G81_post.py index 92ad1be73a..2d3328e0fa 100755 --- a/src/Mod/Path/PathScripts/post/grbl_G81_post.py +++ b/src/Mod/Path/PathScripts/post/grbl_G81_post.py @@ -234,7 +234,7 @@ def export(objectslist, filename, argstring): print("done postprocessing.") #write the file - gfile = pythonopen(filename,"wb") + gfile = pythonopen(filename,"w") gfile.write(gcode) gfile.close() diff --git a/src/Mod/Path/PathScripts/post/grbl_post.py b/src/Mod/Path/PathScripts/post/grbl_post.py index 8cd76020aa..ddb3955cf5 100644 --- a/src/Mod/Path/PathScripts/post/grbl_post.py +++ b/src/Mod/Path/PathScripts/post/grbl_post.py @@ -223,7 +223,7 @@ def export(objectslist,filename,argstring): print("done postprocessing.") - gfile = pythonopen(filename,"wb") + gfile = pythonopen(filename,"w") gfile.write(gcode) gfile.close() diff --git a/src/Mod/Path/PathScripts/post/linuxcnc_post.py b/src/Mod/Path/PathScripts/post/linuxcnc_post.py index b3e186ce56..a73750d65d 100644 --- a/src/Mod/Path/PathScripts/post/linuxcnc_post.py +++ b/src/Mod/Path/PathScripts/post/linuxcnc_post.py @@ -231,7 +231,7 @@ def export(objectslist, filename, argstring): print("done postprocessing.") if not filename == '-': - gfile = pythonopen(filename, "wb") + gfile = pythonopen(filename, "w") gfile.write(final) gfile.close() diff --git a/src/Mod/Path/PathScripts/post/opensbp_post.py b/src/Mod/Path/PathScripts/post/opensbp_post.py index 495f7a3662..307f43c551 100644 --- a/src/Mod/Path/PathScripts/post/opensbp_post.py +++ b/src/Mod/Path/PathScripts/post/opensbp_post.py @@ -173,7 +173,7 @@ def export(objectslist, filename, argstring): print("done postprocessing.") # Write the output - gfile = pythonopen(filename, "wb") + gfile = pythonopen(filename, "w") gfile.write(final) gfile.close() diff --git a/src/Mod/Path/PathScripts/post/philips_post.py b/src/Mod/Path/PathScripts/post/philips_post.py index df22d91b88..60c589c31e 100644 --- a/src/Mod/Path/PathScripts/post/philips_post.py +++ b/src/Mod/Path/PathScripts/post/philips_post.py @@ -531,6 +531,6 @@ def export(objectslist, filename, argstring): gcode += linenumberify(GCODE_FOOTER) if SHOW_EDITOR: PostUtils.editor(gcode) - gfile = pythonopen(filename, "wb") + gfile = pythonopen(filename, "w") gfile.write(gcode) gfile.close() diff --git a/src/Mod/Path/PathScripts/post/rml_post.py b/src/Mod/Path/PathScripts/post/rml_post.py index 1df990ef72..5400fcae12 100644 --- a/src/Mod/Path/PathScripts/post/rml_post.py +++ b/src/Mod/Path/PathScripts/post/rml_post.py @@ -51,7 +51,7 @@ def export(objectslist, filename, argstring): for obj in objectslist: code += convertobject(obj) - gfile = pythonopen(filename,"wb") + gfile = pythonopen(filename,"w") gfile.write(code) gfile.close() diff --git a/src/Mod/Path/PathScripts/post/smoothie_post.py b/src/Mod/Path/PathScripts/post/smoothie_post.py index 051bbd4ae1..6fcc907176 100644 --- a/src/Mod/Path/PathScripts/post/smoothie_post.py +++ b/src/Mod/Path/PathScripts/post/smoothie_post.py @@ -243,7 +243,7 @@ def export(objectslist, filename, argstring): else: if not filename == '-': - gfile = pythonopen(filename, "wb") + gfile = pythonopen(filename, "w") gfile.write(final) gfile.close()