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

How to specify protocol of pickle.dumps in ext.redis? #181

Open
lypro09539 opened this issue Oct 21, 2019 · 1 comment
Open

How to specify protocol of pickle.dumps in ext.redis? #181

lypro09539 opened this issue Oct 21, 2019 · 1 comment

Comments

@lypro09539
Copy link

Hello,
I use redis as cache backend. Because of different default pickle protocol in python2 and python3, data cached in service A( which use python3) cannot be resolving correctly after being retrieved in service B(use python2 environment) , and I got "unsupported pickle protocol: 3"

Would you plz help me figure out what am I supposed to do to handle this situation ? Or would it be feasible to pass 'protocol' param to RedisNamespaceManager?

@amol-
Copy link
Collaborator

amol- commented Oct 21, 2019

Python2 doesn't support pickle protocol 3, which was introduced in Python3.
There is no way to load data in Pickle3 from Python2. But you can set the pickle.DEFAULT_PROTOCOL in Python3 which will tell pickle which version of the protocol to use when saving data.

The data you already had saved in pickle3 must be migrated back to pickle2 btw.

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

No branches or pull requests

2 participants