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

Drop _abc._abc_data from saving. #558

Closed

Conversation

ryanthompson591
Copy link

This prevents an exception when havng a class implementing an ABCMeta class.

Please review this carefully to make sure it fits with dills workflow.

Background:
When pickling a class that inherits from metaclass=abc.ABCMeta dill crashes with an error:

TypeError: cannot pickle '_abc._abc_data' object

This can be bypassed by dropping _abc_impl from the dictionary in save_type.

@mmckerns
Copy link
Member

@ryanthompson591: Thanks for submitting this PR. This seems to be a duplicate of a subset of #450. Note also your PR is currently failing for pypy.

@ryanthompson591
Copy link
Author

It looks like that PR does something similar to what I am doing, on line 2006 of _dill.py in their PR.

@mmckerns - what do you suggest. Should I drop this PR since it might duplicate work already being done?

@mmckerns
Copy link
Member

Should I drop this PR since it might duplicate work already being done?

I'm pretty sure it can be left to the other PR, and we can close this one.

@mmckerns mmckerns added this to the dill-0.3.6 milestone Oct 17, 2022
@mmckerns
Copy link
Member

closing

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

Successfully merging this pull request may close these issues.

2 participants