BOLTS fails to load a ui file called "bolts_widget.ui", the error message suggests a escaping issue:Windows 7
Platform: 32-bit
Version: 0.14.3389
Python version: 2.6.2
Qt version: 4.5.2
Coin version: 3.1.0
SoQt version: 1.4.1
OCC version: 6.5.1
Apparently, the "\b" in the path gets interpreted as an escape sequence. However, I use os.path.join to construct all the paths, so everything should be properly escaped.0.14\bin\python26.zip\xml\etree\ElementTree.py", line 579, in parse <type 'exceptions.IOError'>:
[Errno 22] invalid mode ('rb') or filename: 'C:\Program Files (x86)\FreeCAD 0.14\BOLTS\gui\x08oltswidget.ui
Further investigation suggests that the problem might be in uic
as
Code: Select all
open(r"C:\Program Files (x86)\FreeCAD 0.14\BOLTS\gui\boltswidget.ui")
open("C:\\Program Files (x86)\\FreeCAD 0.14\\BOLTS\\gui\\boltswidget.ui")
Code: Select all
uic.loadUiType(r"C:\Program Files (x86)\FreeCAD 0.14\BOLTS\gui\boltswidget.ui")
uic.loadUiType("C:\\Program Files (x86)\\FreeCAD 0.14\\BOLTS\\gui\\boltswidget.ui")
Looking at the PySideUicModule code (src/Gui/WidgetFactory.cpp:445), I believe escaping might be lost when constructing the python script in-memory.
Now I am not sure about how to best work around this. Just replacing the backslashes to forward slashes might work, as apparently windows recognises them as path separators.