Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toString() error on array types #490

Open
electromuis opened this issue Apr 25, 2024 · 3 comments
Open

toString() error on array types #490

electromuis opened this issue Apr 25, 2024 · 3 comments

Comments

@electromuis
Copy link

When trying to make an array out of a linked part in an assembly and try to save, I get the error:

20:36:37 PropertyPythonObject::toString(): failed for <class 'Asm4_objects.ExpressionArray'> 20:36:37 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 20:36:37 PropertyPythonObject::toString(): failed for <class 'Asm4_objects.ViewProviderArray'> 20:36:37 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 ViewProviderLink is not JSON serializable

Freecad version: 0.21.2
Running on commit 83c713e

(Same error happens to v0.50.7)

@Zolko-123
Copy link
Owner

Yes I see it. It works in 0.21.0 so it's a FreeCAD regression. Let's hope it is fixed in the upcoming 0.21.3

@Zolko-123
Copy link
Owner

I can confirm that this happens on FreeCAD v0.21.2, but works in v0.21.1 and in latest 0.22 weekly build (Version: 0.22.0dev.37573 (Git) AppImage).

I think that it's due to the backport from the 0.22 branch of some bleeding-edge Python 3.11 stuff.

My advice : use FreeCAD v0.21.1

@Zolko-123
Copy link
Owner

This should be fixed in the latest development branch. Will be in the main branch soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants