This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Unexpected instantiation behavior for xml.etree.ElementTree.XMLParser(target=None)
Type: behavior Stage: resolved
Components: Extension Modules, XML Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: eli.bendersky, jacobtylerwalls, miss-islington, rdsteed, scoder, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2021-12-01 14:07 by rdsteed, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
XMLParserFail.py rdsteed, 2021-12-01 14:07 Commented example of unexpected behavior
Pull Requests
URL Status Linked Edit
PR 31152 merged jacobtylerwalls, 2022-02-06 00:31
PR 31292 merged miss-islington, 2022-02-12 08:27
PR 31299 merged jacobtylerwalls, 2022-02-12 15:50
Messages (6)
msg407458 - (view) Author: Robert Steed (rdsteed) * Date: 2021-12-01 14:07
Expected instantiation of xml.etree.ElementTree.XMLParser(target=None) to create a parser using default TreeBuilder
msg412822 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2022-02-08 09:13
This is a backwards incompatible change, but unlikely to have a wide impact.

I was thinking for a second if it's making the change in the right direction because it's not unreasonable to pass "None" for saying "I want no target". But it's documented this way and lxml does it the same, so I agree that this should be changed to make "None" behave the same as no argument.
msg412823 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2022-02-08 09:25
I do not think it is a backwards incompatible change, but concur with the rest said by Stefan.
msg413117 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2022-02-12 08:27
New changeset 168fd6453b5de15236116f9261d64601d92571ac by Jacob Walls in branch 'main':
bpo-45948: Remove constructor discrepancy in C version of ElementTree.XMLParser (GH-31152)
https://github.com/python/cpython/commit/168fd6453b5de15236116f9261d64601d92571ac
msg413119 - (view) Author: miss-islington (miss-islington) Date: 2022-02-12 08:50
New changeset b7a65c939c93e7910abc8c9d4a129ff385714824 by Miss Islington (bot) in branch '3.10':
bpo-45948: Remove constructor discrepancy in C version of ElementTree.XMLParser (GH-31152)
https://github.com/python/cpython/commit/b7a65c939c93e7910abc8c9d4a129ff385714824
msg413148 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2022-02-13 00:16
New changeset cc6d8f88289917d67237a10f7a0e2439fde7a573 by Jacob Walls in branch '3.9':
[3.9] bpo-45948: Remove constructor discrepancy in C version of ElementTree.XMLParser (GH-31152) (GH-31299)
https://github.com/python/cpython/commit/cc6d8f88289917d67237a10f7a0e2439fde7a573
History
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90106
2022-02-13 00:17:02serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-02-13 00:16:39serhiy.storchakasetmessages: + msg413148
2022-02-12 15:50:45jacobtylerwallssetpull_requests: + pull_request29458
2022-02-12 08:50:18miss-islingtonsetmessages: + msg413119
2022-02-12 08:27:14miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request29451
2022-02-12 08:27:09serhiy.storchakasetmessages: + msg413117
2022-02-08 09:25:04serhiy.storchakasetmessages: + msg412823
2022-02-08 09:13:08scodersetmessages: + msg412822
2022-02-08 07:41:11serhiy.storchakasetnosy: + serhiy.storchaka

components: + Extension Modules
versions: + Python 3.9, Python 3.10, Python 3.11, - Python 3.8
2022-02-08 03:44:13ned.deilysetnosy: + scoder, eli.bendersky
2022-02-06 00:31:43jacobtylerwallssetkeywords: + patch
nosy: + jacobtylerwalls

pull_requests: + pull_request29329
stage: patch review
2021-12-01 14:07:52rdsteedcreate