-
Notifications
You must be signed in to change notification settings - Fork 16
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
Usage of json.dumps before deserialization @import #212
Labels
question
Further information is requested
Comments
The reason is that not all deserializers support the |
I confirm this is a breaking one: Traceback (most recent call last): File "/app/lib/python3.11/site-packages/collective/exportimport/import_content.py", line 409, in import_new_content new = self.handle_new_object(item, index, new) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/lib/python3.11/site-packages/collective/exportimport/import_content.py", line 430, in handle_new_object self.request["BODY"] = json.dumps(item) ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/__init__.py", line 231, in dumps return _default_encoder.encode(obj) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/encoder.py", line 200, in encode chunks = self.iterencode(o, _one_shot=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/encoder.py", line 258, in iterencode return _iterencode(o, 0) ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/encoder.py", line 180, in default raise TypeError(f'Object of type {o.__class__.__name__} ' TypeError: Object of type Decimal is not JSON serializable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Recently there was a change to deserializing when importing a new item. Now the item data is converted to a json string before the deserializer using json.dumps. This causes issues when deserializing decimal values however. So i was wondering why this change was made and if this change could be reverted?
The text was updated successfully, but these errors were encountered: