Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML C14N serialisation fails with default namespace #86066

Closed
scoder opened this issue Oct 1, 2020 · 4 comments
Closed

XML C14N serialisation fails with default namespace #86066

scoder opened this issue Oct 1, 2020 · 4 comments
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes topic-XML type-bug An unexpected behavior, bug, or error

Comments

@scoder
Copy link
Contributor

scoder commented Oct 1, 2020

BPO 41900
Nosy @scoder, @miss-islington
PRs
  • bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a default namespace was defined. #22474
  • [3.9] bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a default namespace was defined. (GH-22474) #22507
  • [3.8] bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a default namespace was defined. (GH-22474) #22508
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-10-03.06:44:34.583>
    created_at = <Date 2020-10-01.08:09:31.705>
    labels = ['expert-XML', 'type-bug', '3.8', '3.9', '3.10']
    title = 'XML C14N serialisation fails with default namespace'
    updated_at = <Date 2020-10-03.06:44:34.583>
    user = 'https://github.com/scoder'

    bugs.python.org fields:

    activity = <Date 2020-10-03.06:44:34.583>
    actor = 'scoder'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-10-03.06:44:34.583>
    closer = 'scoder'
    components = ['XML']
    creation = <Date 2020-10-01.08:09:31.705>
    creator = 'scoder'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41900
    keywords = ['patch']
    message_count = 4.0
    messages = ['377743', '377855', '377856', '377857']
    nosy_count = 2.0
    nosy_names = ['scoder', 'miss-islington']
    pr_nums = ['22474', '22507', '22508']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue41900'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @scoder
    Copy link
    Contributor Author

    scoder commented Oct 1, 2020

    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

    @scoder scoder added 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes topic-XML type-bug An unexpected behavior, bug, or error labels Oct 1, 2020
    @scoder
    Copy link
    Contributor Author

    scoder commented Oct 3, 2020

    New changeset 6a412c9 by scoder in branch 'master':
    bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a default namespace was defined. (GH-22474)
    6a412c9

    @scoder
    Copy link
    Contributor Author

    scoder commented Oct 3, 2020

    New changeset a0f2b66 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)
    a0f2b66

    @scoder
    Copy link
    Contributor Author

    scoder commented Oct 3, 2020

    New changeset cfed534 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)
    cfed534

    @scoder scoder closed this as completed Oct 3, 2020
    @scoder scoder closed this as completed Oct 3, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes 3.9 only security fixes 3.10 only security fixes topic-XML type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant