Skip to content

AttributeDict could not pickle#8

Open
Ledenel wants to merge 2 commits into
grimen:masterfrom
Ledenel:master
Open

AttributeDict could not pickle#8
Ledenel wants to merge 2 commits into
grimen:masterfrom
Ledenel:master

Conversation

@Ledenel

@Ledenel Ledenel commented Mar 29, 2020

Copy link
Copy Markdown

According to python pickle, object containing pickable object (Including AttributeDict) should pickle.

But AttributeDict implements __reduce__ which override the origin pickle process, and even call __reduce__ on __dict__ doesn't actually pickle a dict. Instead, it will throw TypeError: can't pickle dict objects even the __dict__ itself is pickable.

@codecov

codecov Bot commented Mar 29, 2020

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@Ledenel

Ledenel commented Mar 29, 2020

Copy link
Copy Markdown
Author

Add unittest to reproduce and simply remove reduce to fix it.

@Ledenel Ledenel changed the title [WIP] AttributeDict could not pickle AttributeDict could not pickle Mar 29, 2020
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.

1 participant