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

[A2P] Python 3.11.x and above Json Fix for FreeCAD 0.21.2 and above #614

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

Syres916
Copy link
Contributor

@Syres916 Syres916 commented Jan 18, 2024

In order to fix errors using Python 3.11.x and above while preserving ability for Python 3.10.x and below to still work correctly, example error from another workbench:

  File "/usr/lib/python3.11/json/encoder.py", line 180, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
<class 'TypeError'>: Object of type FeaturePython is not JSON serializable
17:04:02  PropertyPythonObject::toString(): failed for <class 'SheetMetalCmd.SMViewProviderFlat'>
17:04:02  pyException: Traceback (most recent call last):
  File "/usr/lib/python3.11/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/encoder.py", line 200, in encode
    chunks = self.iterencode(o, _one_shot=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/encoder.py", line 258, in iterencode
    return _iterencode(o, 0)
           ^^^^^^^^^^^^^^^^^

Root Cause is FreeCAD/FreeCAD@fbe2fef

Fixes #613

@kbwbe kbwbe changed the base branch from master to tmp January 18, 2024 20:38
@kbwbe kbwbe merged commit c5410ba into kbwbe:tmp Jan 18, 2024
@kbwbe
Copy link
Owner

kbwbe commented Jan 18, 2024

THX @Syres916. Your PR has been merged to master branch.
I wasn't aware of that changes within FC.

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

Successfully merging this pull request may close these issues.

JSON serialisation error
2 participants