Closed
Description
Bug report
Bug description:
>>> from xml.etree.ElementTree import Element
>>> Element("a").extend(Element("a") for i in range(10)) # works
>>> Element("a").extend(1/0 for i in range(10)) # throws unrelated TypeError
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: expected sequence, not "generator"
C-implementation only bug.
Submitting a patch...
CPython versions tested on:
3.12, 3.13, CPython main branch
Operating systems tested on:
macOS, Windows
Linked PRs
- gh-123213: Fixed xml.etree.ElementTree.Element.extend and assignment to no longer hide exceptions #123214
- [3.13] gh-123213: Fixed xml.etree.ElementTree.Element.extend and assignment to no longer hide exceptions (GH-123214) #123257
- [3.12] gh-123213: Fixed xml.etree.ElementTree.Element.extend and assignment to no longer hide exceptions (GH-123214) #123258