Skip to content

gh-144411: Validate slotstate type in pickle.load_build()#144582

Open
Krishna-web-hub wants to merge 4 commits intopython:mainfrom
Krishna-web-hub:pickle-slotstate-fix
Open

gh-144411: Validate slotstate type in pickle.load_build()#144582
Krishna-web-hub wants to merge 4 commits intopython:mainfrom
Krishna-web-hub:pickle-slotstate-fix

Conversation

@Krishna-web-hub
Copy link
Contributor

@Krishna-web-hub Krishna-web-hub commented Feb 7, 2026

  • This fixes the slotstate issue for an object’s __slots__ saved during pickling.
  • This also fixes the difference in slotstate behavior in pickle.py and _pickle.c .
  • Added the NEWS file.

@da-woods
Copy link
Contributor

da-woods commented Feb 8, 2026

I don't think this actually makes the C and Python implementations equivalent. What happens if slotstate is provided but is None?

@Krishna-web-hub
Copy link
Contributor Author

Krishna-web-hub commented Feb 9, 2026

Hi @da-woods, if slotstate is none , then there are no __slots__ to restore ,so unpickling skips slot restoration. matching the behavior of __pickle.c.

Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

I think something went wrong during the rebase?

@bedevere-app
Copy link

bedevere-app bot commented Mar 1, 2026

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@Krishna-web-hub
Copy link
Contributor Author

@ZeroIntensity ,I have made the requested changes; Please review again

@bedevere-app
Copy link

bedevere-app bot commented Mar 1, 2026

Thanks for making the requested changes!

@ZeroIntensity: please review the changes made to this pull request.

@bedevere-app bedevere-app bot requested a review from ZeroIntensity March 1, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants