Skip to content

Properly serialize RecentlyUsedContainers for cache#2349

Merged
kennethreitz merged 1 commit intopsf:masterfrom
sigmavirus24:fix-pickling
Nov 30, 2014
Merged

Properly serialize RecentlyUsedContainers for cache#2349
kennethreitz merged 1 commit intopsf:masterfrom
sigmavirus24:fix-pickling

Conversation

@sigmavirus24
Copy link
Contributor

RecentlyUsedContainers are threadsafe so they require a lock and as such
cannot be serialized with pickle directly. To handle it, we need to
convert it to a dictionary first and then back when deserializing.

Fixes #2345

RecentlyUsedContainers are threadsafe so they require a lock and as such
cannot be serialized with pickle directly. To handle it, we need to
convert it to a dictionary first and then back when deserializing.

Fixes psf#2345
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 named constants!

@kevinburke
Copy link
Contributor

looks good! any way to add a test exposing this issue?

@sigmavirus24
Copy link
Contributor Author

any way to add a test exposing this issue?

Besides the test that failed in the first place? Jenkins isn't running for a reason only @kennethreitz can determine. Had @Lukasa or I been running the tests locally before approving PRs, it probably wouldn't have reached this point.

@Lukasa
Copy link
Member

Lukasa commented Nov 18, 2014

+1 LGTM.

kennethreitz added a commit that referenced this pull request Nov 30, 2014
Properly serialize RecentlyUsedContainers for cache
@kennethreitz kennethreitz merged commit 53d0238 into psf:master Nov 30, 2014
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using RecentlyUsedContainer for session cache breaks pickling

4 participants