FastFieldSolvers Forum
FastFieldSolvers Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
 All Forums
 FastFieldSolvers
 E.M. Workbench
 error running EM_FHNode
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gergaver

Slovenia
2 Posts

Posted - Sep 11 2023 :  12:33:00  Show Profile  Reply with Quote
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

530 Posts

Posted - Sep 11 2023 :  17:23:23  Show Profile  Reply with Quote
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



Go to Top of Page

gergaver

Slovenia
2 Posts

Posted - Sep 12 2023 :  10:31:54  Show Profile  Reply with Quote
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
Go to Top of Page

Enrico

530 Posts

Posted - Sep 13 2023 :  11:16:16  Show Profile  Reply with Quote
Hi Gregor,

thank you - yes, I expect that all the 'utf8_decode' options must be removed now from the translate() function.

Best,
Enrico
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
FastFieldSolvers Forum © 2020 FastFieldSolvers S.R.L. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.06