Skip to content

gh-131357: Add tests for zero-sized bytes objects in test_bytes.py #134234

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 9 commits into from
May 20, 2025

Conversation

abstractedfox
Copy link
Contributor

@abstractedfox abstractedfox commented May 19, 2025

Concerns issue #131357 and adds slightly more descriptive comments for a few functions that crash when passed null

@python-cla-bot
Copy link

python-cla-bot bot commented May 19, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app bedevere-app bot added the tests Tests in the Lib/test dir label May 19, 2025
@bedevere-app

This comment was marked as resolved.

@bedevere-app

This comment was marked as resolved.

Copy link
Contributor

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

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

You need to sign the CLA.


# CRASHES check(NULL)
# CRASHES check(NULL) #PyBytes_CheckExact() expects PyObject*
Copy link
Contributor

Choose a reason for hiding this comment

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

How are these comments related? They should probably be on two lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apologies; that was meant to explain why it crashes (it felt a little vague whether or not it was expected behavior). Would it be better on the next line, or in parenthesis or similar?

Copy link
Contributor

Choose a reason for hiding this comment

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

explain why it crashes

Then it should be on the same line, but without the #, as that makes it seem like 2 different notes.

@bedevere-app

This comment was marked as resolved.

@StanFromIreland
Copy link
Contributor

Please do not click the "Update" button for no reason, see the devguide.

@abstractedfox
Copy link
Contributor Author

Please do not click the "Update" button for no reason, see the devguide.

Oh, I apologize

@vstinner
Copy link
Member

I clicked on [Update branch] to try to repair the CI.

@vstinner
Copy link
Member

Many CI fail with "cancelled", I don't know why :-(

@CAM-Gerlach
Copy link
Member

@vstinner Myself and @webknjaz figured it out, its a longstanding issue with the concurrency group specifier in our workflow not sufficiently disambiguating PRs when multiple contributors submit a PR with the same branch name, in this case main. @abstractedfox will have a PR we assisted them on to fix this that should unblock this one.

@vstinner
Copy link
Member

Close/reopen the PR to try to repair the CI.

@vstinner
Copy link
Member

@vstinner Myself and @webknjaz figured it out, its a longstanding issue with the concurrency group specifier in our workflow not sufficiently disambiguating PRs when multiple contributors submit a PR with the same branch name, in this case main. @abstractedfox will have a PR we assisted them on to fix this that should unblock this one.

I suppose that it's this PR: #134310.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@vstinner vstinner enabled auto-merge (squash) May 20, 2025 12:00
@vstinner vstinner merged commit 306f9e0 into python:main May 20, 2025
67 of 76 checks passed
@picnixz
Copy link
Member

picnixz commented May 20, 2025

@vstinner We backported the tests for bytesarray, do you want to backport those tests as well?

@vstinner vstinner added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels May 20, 2025
@miss-islington-app
Copy link

Thanks @abstractedfox for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 20, 2025
….py (pythonGH-134234)

(cherry picked from commit 306f9e0)

Co-authored-by: abstractedfox <coldcaption@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 20, 2025
….py (pythonGH-134234)

(cherry picked from commit 306f9e0)

Co-authored-by: abstractedfox <coldcaption@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app
Copy link

bedevere-app bot commented May 20, 2025

GH-134378 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label May 20, 2025
@bedevere-app
Copy link

bedevere-app bot commented May 20, 2025

GH-134379 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 May 20, 2025
@vstinner
Copy link
Member

@vstinner We backported the tests for bytesarray, do you want to backport those tests as well?

Sure. Let me backport these changes to 3.13 and 3.14 branches.

vstinner added a commit that referenced this pull request May 20, 2025
…s.py (GH-134234) (#134379)

gh-131357: Add tests for zero-sized bytes objects in test_bytes.py (GH-134234)
(cherry picked from commit 306f9e0)

Co-authored-by: abstractedfox <coldcaption@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit that referenced this pull request May 20, 2025
…s.py (GH-134234) (#134378)

gh-131357: Add tests for zero-sized bytes objects in test_bytes.py (GH-134234)
(cherry picked from commit 306f9e0)

Co-authored-by: abstractedfox <coldcaption@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants