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: XML C14N serialisation fails with default namespace
Type: behavior Stage: resolved
Components: XML Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: miss-islington, scoder
Priority: normal Keywords: patch

Created on 2020-10-01 08:09 by scoder, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 22474 merged scoder, 2020-10-01 08:47
PR 22507 merged miss-islington, 2020-10-03 06:07
PR 22508 merged miss-islington, 2020-10-03 06:07
Messages (4)
msg377743 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2020-10-01 08:09
import xml.etree.ElementTree as ET
xml="""
<X xmlns="http://soap.sforce.com/2006/04/metadata">
    <Y targets="lightning__AppPage,lightning__HomePage"></Y>
</X>"""
print(ET.canonicalize(xml))

Fails with:
ValueError: Namespace "" is not declared in scope
when trying to build the QName of the unnamespaced "targets" attribute.

Originally reported for lxml here:
https://bugs.launchpad.net/lxml/+bug/1869455
msg377855 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2020-10-03 06:07
New changeset 6a412c94b6b68e7e3632562dc7358a12ffd1447f by scoder in branch 'master':
bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a default namespace was defined. (GH-22474)
https://github.com/python/cpython/commit/6a412c94b6b68e7e3632562dc7358a12ffd1447f
msg377856 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2020-10-03 06:41
New changeset a0f2b664335eb689abdecc677e09a193f503af59 by Miss Skeleton (bot) in branch '3.9':
bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a default namespace was defined. (GH-22474) (GH-22507)
https://github.com/python/cpython/commit/a0f2b664335eb689abdecc677e09a193f503af59
msg377857 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2020-10-03 06:42
New changeset cfed5343331350c5737b464970a31f7588319e8b by Miss Skeleton (bot) in branch '3.8':
bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a default namespace was defined. (GH-22474) (GH-22508)
https://github.com/python/cpython/commit/cfed5343331350c5737b464970a31f7588319e8b
History
Date User Action Args
2022-04-11 14:59:36adminsetgithub: 86066
2020-10-03 06:44:34scodersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-10-03 06:42:41scodersetmessages: + msg377857
2020-10-03 06:41:38scodersetmessages: + msg377856
2020-10-03 06:07:33miss-islingtonsetpull_requests: + pull_request21518
2020-10-03 06:07:25miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request21517
2020-10-03 06:07:20scodersetmessages: + msg377855
2020-10-01 08:47:29scodersetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request21493
2020-10-01 08:09:31scodercreate