Skip to content

gh-120380: fix Python implementation of pickle.Pickler for bytes and bytearray objects in protocol version 5. #120422

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

Merged
merged 14 commits into from
Jun 21, 2024

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Jun 12, 2024

The issue is not only for the one in #120380 but also affected 0-copy bytes objects. Actually, the issue is only for the empty case.

I'm not entirely sure it's the simplest way to do it and whether I could perhaps just special-case the empty case.

@picnixz
Copy link
Member Author

picnixz commented Jun 12, 2024

I'll fix the pyclbr tests another day.

@picnixz
Copy link
Member Author

picnixz commented Jun 13, 2024

The pyclbr test does not support using __ prefixes in classes that are being tested. The reason is that it did not consider the case when a class name starts with an underscore and is using __meth, e.g., _A._A__meth and not _A.__A__meth.

Copy link
Member

@encukou encukou left a comment

Choose a reason for hiding this comment

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

Thank you for the fix!

I have a few suggestions.

The test_pyclbr fix would be better off in a separate PR.

@picnixz
Copy link
Member Author

picnixz commented Jun 18, 2024

The test_pyclbr fix has actually a separate PR #120450. I forgot to drop the commits here (or maybe I left them so that the CI/CD passed).

@encukou encukou added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Jun 21, 2024
@encukou encukou merged commit 7595e67 into python:main Jun 21, 2024
35 checks passed
@miss-islington-app
Copy link

Thanks @picnixz for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

@encukou
Copy link
Member

encukou commented Jun 21, 2024

Thank you!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 21, 2024
…ytes` and `bytearray` objects in protocol version 5. (pythonGH-120422)

(cherry picked from commit 7595e67)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 21, 2024
…ytes` and `bytearray` objects in protocol version 5. (pythonGH-120422)

(cherry picked from commit 7595e67)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Jun 21, 2024

GH-120832 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jun 21, 2024
@bedevere-app
Copy link

bedevere-app bot commented Jun 21, 2024

GH-120833 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Jun 21, 2024
@picnixz picnixz deleted the fix-pickler branch June 21, 2024 12:30
encukou pushed a commit that referenced this pull request Jun 26, 2024
…bytes` and `bytearray` objects in protocol version 5. (GH-120422) (GH-120832)

gh-120380: fix Python implementation of `pickle.Pickler` for `bytes` and `bytearray` objects in protocol version 5. (GH-120422)
(cherry picked from commit 7595e67)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
encukou pushed a commit that referenced this pull request Jun 26, 2024
…bytes` and `bytearray` objects in protocol version 5. (GH-120422) (GH-120833)

gh-120380: fix Python implementation of `pickle.Pickler` for `bytes` and `bytearray` objects in protocol version 5. (GH-120422)
(cherry picked from commit 7595e67)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
mrahtz pushed a commit to mrahtz/cpython that referenced this pull request Jun 30, 2024
…ytes` and `bytearray` objects in protocol version 5. (pythonGH-120422)
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
…ytes` and `bytearray` objects in protocol version 5. (pythonGH-120422)
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
…ytes` and `bytearray` objects in protocol version 5. (pythonGH-120422)
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