-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
bpo-37210: Fix pure Python pickle: proto 5 requires _pickle.PickleBuffer #14016
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
Conversation
@pitrou: Would you mind to review my change? Does it sound reasonable to you? |
This sounds both fine but almost pointless to me. Is it for |
It repairs pyperformance, right: to measure performances of the pure Python implementation of pickle. But other Python implementations (PyPy, MicroPython, RustPython, etc.) should also benefit of this change to reuse CPython pickle.py if they miss the _pickle module. |
Ok. I'm not sure you need to downgrade the protocol to 4. You can just disable the code paths which depend on PickleBuffer. |
Fix pure Python implementation of pickle: it failed with ModuleNotFoundError on importing _pickle.PickleBuffer. If _pickle.PickleBuffer is missing, disable PickleBuffer support. Fix test_pickle when _pickle is missing: declare PyPicklerHookTests outside "if has_c_implementation:" block.
Oh, I wasn't sure. I tested test_pickle with I rebased my PR, I reverted my HIGHEST_PROTOCOL change and I made another tiny fix in test_pickle when _pickle is missing. |
@pitrou: Does it look better now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1.
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
…GH-14016) Allow pure Python implementation of pickle to work even when the C _pickle module is unavailable. Fix test_pickle when _pickle is missing: declare PyPicklerHookTests outside "if has_c_implementation:" block. (cherry picked from commit 63ab4ba) Co-authored-by: Victor Stinner <[email protected]>
GH-14055 is a backport of this pull request to the 3.8 branch. |
@pitrou: Thanks for the review, I updated the commit message using your NEWS entry ;-) |
Allow pure Python implementation of pickle to work even when the C _pickle module is unavailable. Fix test_pickle when _pickle is missing: declare PyPicklerHookTests outside "if has_c_implementation:" block. (cherry picked from commit 63ab4ba) Co-authored-by: Victor Stinner <[email protected]>
…GH-14016) Allow pure Python implementation of pickle to work even when the C _pickle module is unavailable. Fix test_pickle when _pickle is missing: declare PyPicklerHookTests outside "if has_c_implementation:" block.
…GH-14016) Allow pure Python implementation of pickle to work even when the C _pickle module is unavailable. Fix test_pickle when _pickle is missing: declare PyPicklerHookTests outside "if has_c_implementation:" block.
Fix pure Python implementation of pickle: it failed with
ModuleNotFoundError on importing _pickle.PickleBuffer. If
_pickle.PickleBuffer is missing, change HIGHEST_PROTOCOL from 5 to 4
and disable PickleBuffer support.
https://bugs.python.org/issue37210