Skip to content

gh-131938: Update error message for Element.remove() when an element is not found #131972

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 4 commits into from
Apr 4, 2025

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Apr 1, 2025

@picnixz
Copy link
Member Author

picnixz commented Apr 1, 2025

@vstinner You suggested this in the other PR, but I don't know if you want me to align the Python implementation as well. More generally, what's the policy when we have a C and a Python implementation: should the exception messages match as much as possible or is it fine to have discrepencies?

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

Co-authored-by: Victor Stinner <vstinner@python.org>
@picnixz
Copy link
Member Author

picnixz commented Apr 1, 2025

I'm actually leaving now so won't have time to push this, I'll do it on Friday though!

@picnixz picnixz self-assigned this Apr 1, 2025
@picnixz picnixz enabled auto-merge (squash) April 4, 2025 13:14
@vstinner
Copy link
Member

vstinner commented Apr 4, 2025

The Windows x64 job failed with a network issue (urllib.error.HTTPError: HTTP Error 504: Gateway Timeout). I restarted the job.

@picnixz picnixz merged commit 04bc681 into python:main Apr 4, 2025
44 checks passed
@picnixz picnixz deleted the feat/xml/remove-error-message-131938 branch April 8, 2025 10:58
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
… an element is not found (python#131972)

The exception message for `xml.etree.ElementTree.Element.remove` when an element is not found
has been updated from "list.remove(x): x not in list" to "Element.remove(x): element not found".
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.

2 participants