Closed
Labels
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
Activity
bharel commentedon Aug 22, 2024
Also happens on assignment:
Patching up...
[-]ElementTree.extend hides exceptions from underlying generators.[/-][+]Element.extend hides exceptions from underlying generators.[/+]gh-123213: Fixed xml.etree.ElementTree.Element.extend and assignment …
pythongh-123213: Fixed xml.etree.ElementTree.Element.extend and assig…
pythongh-123213: Fixed xml.etree.ElementTree.Element.extend and assig…
bharel commentedon Aug 23, 2024
Fixed 🎉
[3.13] gh-123213: Fixed xml.etree.ElementTree.Element.extend and assi…
[3.12] gh-123213: Fixed xml.etree.ElementTree.Element.extend and assi…