Skip to content

Update Element.remove exception message when an element is not found #131938

Closed
@picnixz

Description

@picnixz

Proposal:

In xml.etree.ElementTree.Element.remove, the exception message is "list.remove(x): x not in list". It was suggested to change it to "Element.remove(x): x not in list" (#126124 (comment)).

Since we don't like changing exception messages in stable branches, we will only do it in main. Note that this change may not necessarily be trivial as the Python implementation also needs to be updated (out there, a list is used and using list.remove() would then use a different message).

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

#126124 (comment)

Linked PRs

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions