Repository navigation
Remove legacy safe pickle system - #3857
Conversation
It is something to difficult figure out when this became irrelevant, but modern pickle-able classes do not need to have a __safe_for_unpickling__ property / method. PEP 303 from Python 2.3 talks about it in past tense (https://peps.python.org/pep-0307/#security-issues), but it is documented as needed until Python 2.7 (https://docs.python.org/release/2.7.18/library/pickle.html#pickling-and-unpickling-extension-types). By 3.1 at the latest, it was removed (https://docs.python.org/3.1/library/pickle.html#pickle.object.__reduce__)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (3)
📝 WalkthroughWalkthroughRemoves the ChangesSafe-unpickling marker removal
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
I checked cpython sources and yes, I found this line
NOTE: checks for safe_for_unpickling went away in Python 2.3.
And of course, no line of code actually dealing with this attribute. We should be good to go with this cleanup (which is long overdue, over 23 years late xD)
|
oddbookworm
left a comment
There was a problem hiding this comment.
Thought I approved this before.... oops. LGTM!
It is something to difficult figure out when this became irrelevant, but modern pickle-able classes do not need to have a __safe_for_unpickling__ property / method. PEP 303 from Python 2.3 talks about it in past tense (https://peps.python.org/pep-0307/#security-issues), but it is documented as needed until Python 2.7 (https://docs.python.org/release/2.7.18/library/pickle.html#pickling-and-unpickling-extension-types). By 3.1 at the latest, it was removed (https://docs.python.org/3.1/library/pickle.html#pickle.object.__reduce__)