Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
bpo-1635741: In pickle module, inject module state from class methods#23304
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
koubaa commented Nov 15, 2020 • edited by bedevere-bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-bot
Uh oh!
There was an error while loading. Please reload this page.
koubaa commented Nov 15, 2020
@vstinner@corona10@shihai1991 please review |
Modules/_pickle.c Outdated
koubaaNov 15, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
PickleState is not used here, but is added as an argument to avoid complicating the macro/switch case in
static PyObject * load(UnpicklerObject *self, PickleState *st) tiran commented Nov 18, 2020
Most modules are using |
koubaa commented Nov 20, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@tiran I did that in my initial draft here. The reason I didn't do it here is because there are local variables named state in some functions (see for example line 3949 in save_reduce. Do you have a suggestion on what to change those names to? I don't understand exactly what those variables represent |
This PR is stale because it has been open for 30 days with no activity. |
shihai1991 left a comment
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.
The reason I didn't do it here is because there are local variables named state in some functions (see for example line 3949 in save_reduce.
the state would be more exact. If there have other arguments have own this name, keep st unchanged is not a big probleam.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
when switching to heap types, the clinic can be used to get the module state therte
d7cad26 to eea5c35Comparekoubaa commented Mar 7, 2021
@shihai1991@vstinner I addressed these comments |
shihai1991 left a comment
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.
This PR is huge :) . About adding parenthesis, I will update it when those code have relation with the bpo.
iritkatriel commented Apr 11, 2022
https://bugs.python.org/issue1635741 is closed. What is the status of this PR? |
vstinner commented Apr 19, 2022
The change is still relevant, but should use a new issue number. Moreover, the SC asked to put the conversion of static types to heap types on hold. @encukou and @erlend-aasland wrote https://peps.python.org/pep-0687/ which may unblock the situation but it's still a draft. |
erlend-aasland commented Jul 20, 2022
FYI, PEP 687 was accepted. |
encukou commented Mar 28, 2024
Pickle module state was isolated in #102982. |
erlend-aasland commented Mar 28, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
It did; PR #102982 was based off of Mohamed's work in #23188 (IIRC, I cherry-picked the commits from |
This PR prepares for changing to heap types.
When switching to heap types, the clinic can be used to get the module state.
https://bugs.python.org/issue1635741