Author |
Topic  |
|
gergaver
Slovenia
2 Posts |
Posted - Sep 11 2023 : 12:33:00
|
Hello, I have problems creating FHNode in FreeCAD. When I select the button, I receive the following error:
12:24:40 Running the Python command 'EM_FHNode' failed: Traceback (most recent call last): File "C:\Users\gregor.ergaver\AppData\Roaming\FreeCAD\Mod\EM\EM_FHNode.py", line 322, in Activated FreeCADGui.Snapper.getPoint(callback=self.getPoint,movecallback=self.move,extradlg=self.taskbox()) File "C:\Users\gregor.ergaver\AppData\Roaming\FreeCAD\Mod\EM\EM_FHNode.py", line 350, in taskbox w.setWindowTitle(translate("EM","FHNode options", utf8_decode=True))
translate() got an unexpected keyword argument 'utf8_decode'
Any idea, what could be wrong? I am running FreeCAD 0.21.1 and ElectroMagnetic workbench for FreeCAD.
Thanks. |
|
Enrico
545 Posts |
Posted - Sep 11 2023 : 17:23:23
|
Hi Gergaver,
the 'utf8_decode' option was used at Python2 time. It should have not triggered an issue even under Python3, but apparently the code has been recently cleaned up (I can see the git commit ht*ps://github.com/FreeCAD/FreeCAD/commit/87b0893044f16da41aa84a500d7faaa895a953aa as per Mar 28, 2023) and it is now sensitive to these options.
I will need to update the sources. As a quick fix, you can try removing the option yourself from the code, i.e.
Was:
w.setWindowTitle(translate("EM","FHNode options", utf8_decode=True))
Becomes:
w.setWindowTitle(translate("EM","FHNode options"))
Best Regards, Enrico
|
 |
|
gergaver
Slovenia
2 Posts |
Posted - Sep 12 2023 : 10:31:54
|
Hello Enrico,
thank you for prompt reply.
Also for other users, I had to also change the following line:
from: label4 = QtGui.QLabel(translate("EM","Con&tinue", utf8_decode=True))
to:
label4 = QtGui.QLabel(translate("EM","Con&tinue"))
BR, Gregor |
 |
|
Enrico
545 Posts |
Posted - Sep 13 2023 : 11:16:16
|
Hi Gregor,
thank you - yes, I expect that all the 'utf8_decode' options must be removed now from the translate() function.
Best, Enrico
|
 |
|
|
Topic  |
|
|
|