Bug 2576588 - python-scour fails to build with Python 3.16: xml.dom.NamespaceErr: illegal use of the 'xmlns' attribute for the wrong namespace
Summary: python-scour fails to build with Python 3.16: xml.dom.NamespaceErr: illegal u...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-scour
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.16
TreeView+ depends on / blocked
 
Reported: 2026-11-19 12:57 UTC by Karolina Surma
Modified: 2026-11-19 12:58 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2026-11-19 12:57:55 UTC
python-scour fails to build with Python 3.16.0a2.

__________________ MoveSVGElementsToDefaultNamespace.runTest ___________________

self = <test_scour.MoveSVGElementsToDefaultNamespace testMethod=runTest>

    def runTest(self):
        with open('unittests/xml-ns-decl.svg') as f:
>           xmlstring = scourString(f.read())
                        ^^^^^^^^^^^^^^^^^^^^^

test_scour.py:1716: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
scour/scour.py:3750: in scourString
    remapNamespacePrefix(doc.documentElement, prefix, '')
scour/scour.py:3448: in remapNamespacePrefix
    newNode.setAttributeNS(attr.namespaceURI, attr.name, attr.nodeValue)
/usr/lib64/python3.16/xml/dom/minidom.py:944: in setAttributeNS
    _check_qualified_name(namespaceURI, qualifiedName, True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

namespaceURI = None, qualifiedName = 'xmlns', attribute = True

    def _check_qualified_name(namespaceURI, qualifiedName, attribute=False):
        """Check a namespace URI and a qualified name (see DOM Level 2 Core)."""
        _check_name(qualifiedName)
        prefix, sep, localName = qualifiedName.partition(':')
        if sep:
            if not localName or ':' in localName or not xml.is_valid_name(localName):
                raise xml.dom.NamespaceErr(
                    "%r is not a valid qualified name" % (qualifiedName,))
            _check_prefix(prefix, namespaceURI, attribute)
        elif attribute and (qualifiedName == "xmlns") != (namespaceURI == XMLNS_NAMESPACE):
>           raise xml.dom.NamespaceErr(
                "illegal use of the 'xmlns' attribute for the wrong namespace")
E           xml.dom.NamespaceErr: illegal use of the 'xmlns' attribute for the wrong namespace


https://docs.python.org/3.16/whatsnew/3.16.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.16/fedora-rawhide-x86_64/11359703-python-scour/

For all our attempts to build python-scour with Python 3.16, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.16/package/python-scour/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.16:
https://copr.fedorainfracloud.org/coprs/g/python/python3.16/

Let us know here if you have any questions.

Python 3.16 is planned to be included in Fedora 47.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.16.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.


Note You need to log in before you can comment on or make changes to this bug.