abstractedfox · GitHub

Bug report

Bug description:

Example:

tree = xml.etree.ElementTree.ElementTree(element = "") # element should be an ElementTree.Element object or None
tree.write("file.xml") # This appropriately causes a traceback, but blanks file.xml if it exists

PR coming with a fix!

CPython versions tested on:

CPython main branch, 3.14

Operating systems tested on:

macOS

Linked PRs

Read the original on github.com ↗