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

Save object ids as zodbpickle.binary and use pickle protocol 3 for Python 2 #194

Merged
merged 1 commit into from
Mar 26, 2018

Conversation

jimfulton
Copy link
Member

Fixes #193

  (Previously, protocol 2 was used for Python 2.)

  The zodbpickle package provides a `zodbpickle.binary` string type
  that should be used in Python 2 to cause binary strings to be saved
  in a pickle binary format, so they can be loaded correctly in
  Python 3.  Pickle protocol 3 is needed for this to work correctly.

- Object identifiers in persistent references are saved as
  `zodbpickle.binary` strings in Python 2, so that they are loaded
  correctly in Python 3.
Copy link
Member

@jamadden jamadden left a comment

Choose a reason for hiding this comment

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

LGTM.

For the record, I'll comment that there are some implementations that use persistent but do not use byte/binary OIDs. Those implementations shouldn't be affected by this.

@jimfulton
Copy link
Member Author

Thanks. WRT OIDs, I went through the same thought process. :)

@jimfulton jimfulton merged commit 12ee41c into master Mar 26, 2018
@jimfulton jimfulton deleted the python3-compatible-persistent-refs branch March 26, 2018 13:21
@jamadden
Copy link
Member

I can confirm that RelStorage tests pass with this change.

@jimfulton
Copy link
Member Author

Thanks!

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