From 279453662f9ae944f4bd2528f7e9ebd5000c98ed Mon Sep 17 00:00:00 2001 From: Reinier Heeres Date: Sun, 7 Jun 2020 14:52:13 +0200 Subject: [PATCH] Fix saving of DXF files (python3) - Python3 does not allow to write strings to a file opened as "wb"; it expects bytes instead. Since ASCII DXF files are written using strings, the file should be opened as "w". Should be ok for python2 as well. - See also issue 003862, https://tracker.freecadweb.org/view.php?id=3862 --- src/Mod/Draft/importDXF.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Draft/importDXF.py b/src/Mod/Draft/importDXF.py index f78b0a2a94..795098d86a 100644 --- a/src/Mod/Draft/importDXF.py +++ b/src/Mod/Draft/importDXF.py @@ -3932,7 +3932,7 @@ def exportPage(page, filename): c = dxfcounter() pat = re.compile("(_handle_)") template = pat.sub(c.incr, template) - f = pythonopen(filename, "wb") + f = pythonopen(filename, "w") f.write(template) f.close()