Author |
Topic  |
|
carlos_mtz_de_guerenu
Spain
3 Posts |
Posted - Jul 22 2024 : 17:01:56
|
I've recently updated my computer to w11 and Freecad 0.21.2 I have some previous models that now are not working, and I'm unable to make any new model. A simple example, if I create a new model, then insert FHSolver, and then a new Node (setting the xyz data). The problem arises if I want to copy (^-C) the node. I get the following error message:
16:45:34 PropertyPythonObject::toString(): failed for <class 'EM_FHNode._FHNode'> 16:45:34 Traceback (most recent call last): File "C:\Program Files\FreeCAD 0.21\bin\lib\json\__init__.py", line 231, in dumps return _default_encoder.encode(obj) File "C:\Program Files\FreeCAD 0.21\bin\lib\json\encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "C:\Program Files\FreeCAD 0.21\bin\lib\json\encoder.py", line 257, in iterencode return _iterencode(o, 0) File "C:\Program Files\FreeCAD 0.21\bin\lib\json\encoder.py", line 179, in default raise TypeError(f'Object of type {o.__class__.__name__} ' <class 'TypeError'>: Object of type FeaturePython is not JSON serializable 16:45:34 PropertyPythonObject::toString(): failed for <class 'EM_FHNode._ViewProviderFHNode'> 16:45:34 Traceback (most recent call last): File "C:\Program Files\FreeCAD 0.21\bin\lib\json\__init__.py", line 231, in dumps return _default_encoder.encode(obj) File "C:\Program Files\FreeCAD 0.21\bin\lib\json\encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "C:\Program Files\FreeCAD 0.21\bin\lib\json\encoder.py", line 257, in iterencode return _iterencode(o, 0) File "C:\Program Files\FreeCAD 0.21\bin\lib\json\encoder.py", line 179, in default raise TypeError(f'Object of type {o.__class__.__name__} ' <class 'TypeError'>: Object of type FeaturePython is not JSON serializable
How can I fix the problem?
Carlos Mtz. de Guereñu |
|
Enrico
545 Posts |
Posted - Jul 22 2024 : 21:29:04
|
Which version of the E.M. workbench are you using? Are you on the last i.e. 2.1.1?
Best, Enrico
|
 |
|
carlos_mtz_de_guerenu
Spain
3 Posts |
Posted - Jul 23 2024 : 08:00:38
|
I'm using 2.1.1 version, using Freecad Add-on manager
Carlos Mtz. de Guereñu |
 |
|
Enrico
545 Posts |
Posted - Jul 23 2024 : 17:24:21
|
Ok, I verified that the issue starts with FreeCAD 0.21.2, in previous version 0.21.1 JSON serialization was working.
I need to check what was changed in the FeaturePython implementation and fix the issue.
Mainly this is related to save / autosave, but of course you need to be able to save/load project.
Thanks for the reporting Enrico
|
 |
|
Enrico
545 Posts |
Posted - Jul 23 2024 : 18:04:40
|
Ah yes, I re-checked and now I remembered. This is a non-backward compatible issue that appeared in FreeCAD 0.21.2 and is not directly depending from the workbenches. All the workbenches were equally impacted.
Eventually the FreeCAD developers implemented a work-around to keep backward compatibility, but the 0.21.2 as it is does not contain it. I expect that the development branch is ok (higher version than 0.21.2). In alternative you can install 0.21.1, that is still working fine.
You can find the information relevant to this FreeCAD issue here (replace the anti-spam * with the proper obvious characters):
- The problem reported:
ht*ps://forum.freecad.org/viewtopic.php?t=40812 ht*ps://forum.freecad.org/viewtopic.php?t=61707&start=130
- The solution implemented:
ht*ps://github.com/FreeCAD/FreeCAD/pull/12243
Cheers, Enrico
|
 |
|
carlos_mtz_de_guerenu
Spain
3 Posts |
Posted - Jul 24 2024 : 12:46:57
|
Thank you Enrico.
I've installed Freecad 0.21.1 release and it works!!
Thank you again
Carlos Mtz. de Guereñu |
 |
|
Enrico
545 Posts |
Posted - Jul 24 2024 : 16:28:39
|
To close the loop, I also tested with the 0.22 development version, where the fix should have been included, and I can confirm that the workbench does not show this issue any more.
The version I tested is
OS: Windows 10 build 19045 Word size of FreeCAD: 64-bit Version: 0.22.0dev.38314 (Git)
So I can confirm that the only problematic version is 0.21.2, that unfortunately is still distributed as the latest stable one.
Cheers, Enrico
|
 |
|
|
Topic  |
|
|
|