You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a custom __getstate__ which excludes attributes that are not seriazable. However if there are no other attributes and __getstate__ therefore returns an empty dict, jsonpickle.encode ignores __getstate__, resulting in an error.
Thanks for reporting this! I'm unsure how to properly handle this while maintaining backwards-compatibility though, since this seems like behavior that some people would rely on. I know that the project for which I use jsonpickle actually does rely on this behavior. Would a feature flag be an acceptable solution for this use case?
I have a custom
__getstate__
which excludes attributes that are not seriazable. However if there are no other attributes and__getstate__
therefore returns an empty dict, jsonpickle.encode ignores__getstate__
, resulting in an error.The problem is here (line 627):
jsonpickle/jsonpickle/pickler.py
Lines 618 to 628 in ef95ebc
Just for clarity, this is my code:
The text was updated successfully, but these errors were encountered: