Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Fix infinite recursion when unpickling a mapping type instance #263

Merged
merged 1 commit into from Sep 22, 2014
Merged

Fix infinite recursion when unpickling a mapping type instance #263

merged 1 commit into from Sep 22, 2014

Conversation

batlock666
Copy link

I noticed that unpickling mapping type instances led to infinite recursion. This happened when I tried to cache search results in Django (using django.core.cache).

Reproducing the problem:

# mt is a mapping type instance
import pickle
pickled = pickle.dumps(mt, 2)
unpickled = pickle.loads(pickled)

This should lead to a RuntimeError because of the infinite recursion. The fix prevents this from happening.

@willkg
Copy link
Member

willkg commented Sep 18, 2014

Can you add a test case for this?

@willkg
Copy link
Member

willkg commented Sep 22, 2014

Nevermind. I wrote one.

willkg added a commit that referenced this pull request Sep 22, 2014
Fix infinite recursion when unpickling a mapping type instance
@willkg willkg merged commit 52b9900 into mozilla:master Sep 22, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants