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

BUG: Support WeakSets and ABCMeta instances. #104

Merged
merged 3 commits into from
Jul 1, 2017

Conversation

ssanderson
Copy link

Fixes a bug where pickling instances of instances of ABCMeta (you read
that correctly) would fail because ABCMeta uses several (previously
unpicklable) WeakSets as caches.

We fix the issue by adding support for pickling WeakSets via
save_reduce.

Fixes #103.

@ssanderson
Copy link
Author

TIL weakset was only added in 2.6...

@codecov-io
Copy link

codecov-io commented Jul 1, 2017

Codecov Report

Merging #104 into master will increase coverage by 0.13%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #104      +/-   ##
==========================================
+ Coverage   81.21%   81.34%   +0.13%     
==========================================
  Files           2        2              
  Lines         559      563       +4     
  Branches      112      113       +1     
==========================================
+ Hits          454      458       +4     
  Misses         75       75              
  Partials       30       30
Impacted Files Coverage Δ
cloudpickle/cloudpickle.py 81.25% <100%> (+0.13%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aec80d2...8e90a27. Read the comment docs.

Fixes a bug where pickling instances of instances of ABCMeta (you read
that correctly) would fail because ABCMeta uses several (previously
unpicklable) WeakSets as caches.

We fix the issue by adding support for pickling WeakSets via
`save_reduce`.
@rgbkrk
Copy link
Member

rgbkrk commented Jul 1, 2017

Looking good Scott, thanks.

@rgbkrk rgbkrk merged commit d986894 into cloudpipe:master Jul 1, 2017
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.

Fail to (un)pickle class with abc.ABCMeta metaclass (python 2.7)
3 participants