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

Pickle.dumps does not guarantee ASCII #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

atkinson
Copy link

This was falling in a mess on Postgres when the object being pickled contained encodings other than ASCII.

There's a discrepancy between the docs and reality which you can read about here: http://bugs.python.org/issue2980

I worked around by encoding to base64 before storing the picked object in the db, and then base64 decode on the way out.

Also elected to use the best available decoder seeing as there is no benefit to using the ASCII one (which doesn't guarantee ASCII).

pirandig and others added 3 commits April 23, 2013 16:09
…aranteed to be ASCII, (contradictory to the official docs). Encoding to base64 is necessary in case there are other non-ASCII encodings embedded in the object
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.

2 participants