View Revisions: Issue #3862

Summary 0003862: Export from freecad errors
Revision 2019-02-26 10:37 by Kunda1
Description EXPORT FROM FREECAD ERRORS:

  File "Mod/Draft/importSVG.py", line 1255, in export
    svg.write('<?xml version="1.0"?>\n')
<class 'TypeError'>: a bytes-like object is required, not 'str'

-        svg = pythonopen(filename,'wb')
+        svg = pythonopen(filename,'w')  # b    IT WAS CHANGE! IT IS OK!

  File "Mod/Draft/importSVG.py", line 1287, in export
    .replace('<','<').replace('>','>'))
<class 'TypeError'>: a bytes-like object is required, not 'str'

-                svg.write('<title>%s</title>\n' % ob.Label.encode('utf8')\
-                        .replace('<','<').replace('>','>'))
+                #svg.write('<title>%s</title>\n' % ob.Label.encode('utf8')\
+                #        .replace('<','<').replace('>','>'))

  File "Mod/Draft/importOCA.py", line 265, in export
    oca.write("#oca file generated from FreeCAD\r\n")
<class 'TypeError'>: a bytes-like object is required, not 'str'

-    oca = pythonopen(filename,'wb')
+    oca = pythonopen(filename,'w') #b
Revision 2019-02-25 18:42 by Alexandr Parkhomenko
Description EXPORT FROM FREECAD ERRORS:

  File "Mod/Draft/importSVG.py", line 1255, in export
    svg.write('<?xml version="1.0"?>\n')
<class 'TypeError'>: a bytes-like object is required, not 'str'

- svg = pythonopen(filename,'wb')
+ svg = pythonopen(filename,'w') # b IT WAS CHANGE! IT IS OK!

  File "Mod/Draft/importSVG.py", line 1287, in export
    .replace('<','<').replace('>','>'))
<class 'TypeError'>: a bytes-like object is required, not 'str'

- svg.write('<title>%s</title>\n' % ob.Label.encode('utf8')\
- .replace('<','<').replace('>','>'))
+ #svg.write('<title>%s</title>\n' % ob.Label.encode('utf8')\
+ # .replace('<','<').replace('>','>'))

  File "Mod/Draft/importOCA.py", line 265, in export
    oca.write("#oca file generated from FreeCAD\r\n")
<class 'TypeError'>: a bytes-like object is required, not 'str'

- oca = pythonopen(filename,'wb')
+ oca = pythonopen(filename,'w') #b