Skip to content

Fix unintended behavior change in elementtree introduced in #114269 #114737

Closed
@Prometheus3375

Description

@Prometheus3375

Bug report

Bug description:

As it was discussed here, after merging of #114269 it.root is no longer None once an iterator is created. There was no intention to change this, it should be reverted.

Meanwhile, I think it will be good to add test for root attribute.

  • Right after function returned iterator: it.root must be None.
  • After iterator exhaustion: it.root must be an instance of xml.etree.ElementTree.Element.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Other

Linked PRs

Metadata

Metadata

Assignees

Labels

3.11only security fixes3.12only security fixes3.13bugs and security fixestopic-XMLtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions