You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test suite needs adjustments for Expat >=2.4.5 #90967
It has been reported at https://bugs.python.org/issue46794#msg413587 that the current CPython test suite needs some adjustments for Expat >=2.4.5. Since that is somewhat separate from updating the bundled copy of Expat to >=2.4.6, I am creating this dedicated ticket. I pull request for discussion will follow shortly.
If python is built to use the system libexpat, the version check used in the listed PRs will not necessarily be effective if the distribution ports patches back:
# dpkg -l libexpat1
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===============-===============-============-===============================
ii libexpat1:arm64 2.2.6-2+deb10u4 arm64 XML parsing C library - runtime
# python3 -c "import pyexpat; print(pyexpat.version_info); from xml.dom.minidom import parseString; parseString('<element xmlns:abc=\"http:abc.com/de f g/hi/j k\"><abc:foo /></element>')"
(2, 2, 6)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.10/xml/dom/minidom.py", line 1998, in parseString
return expatbuilder.parseString(string)
File "/usr/local/lib/python3.10/xml/dom/expatbuilder.py", line 925, in parseString
return builder.parseString(string)
File "/usr/local/lib/python3.10/xml/dom/expatbuilder.py", line 223, in parseString
parser.Parse(string, True)
xml.parsers.expat.ExpatError: syntax error: line 1, column 0
# dpkg -i libexpat1_2.2.6-2+deb10u1_arm64.deb
dpkg: warning: downgrading libexpat1:arm64 from 2.2.6-2+deb10u4 to 2.2.6-2+deb10u1
(Reading database ... 22507 files and directories currently installed.)
Preparing to unpack libexpat1_2.2.6-2+deb10u1_arm64.deb ...
Unpacking libexpat1:arm64 (2.2.6-2+deb10u1) over (2.2.6-2+deb10u4) ...
Setting up libexpat1:arm64 (2.2.6-2+deb10u1) ...
Processing triggers for libc-bin (2.28-10+deb10u1) ...
# dpkg -l libexpat1
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===============-===============-============-===============================
ii libexpat1:arm64 2.2.6-2+deb10u1 arm64 XML parsing C library - runtime
# python3 -c "import pyexpat; print(pyexpat.version_info); from xml.dom.minidom import parseString; parseString('<element xmlns:abc=\"http:abc.com/de f g/hi/j k\"><abc:foo /></element>')"
(2, 2, 6)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.10/xml/dom/minidom.py", line 1998, in parseString
return expatbuilder.parseString(string)
File "/usr/local/lib/python3.10/xml/dom/expatbuilder.py", line 925, in parseString
return builder.parseString(string)
File "/usr/local/lib/python3.10/xml/dom/expatbuilder.py", line 223, in parseString
parser.Parse(string, True)
File "/build/python/3.10.2/python-3.10.2/Modules/pyexpat.c", line 416, in StartElement
File "/usr/local/lib/python3.10/xml/dom/expatbuilder.py", line 738, in start_element_handler
uri, localname, prefix, qname = _parse_ns_name(self, name)
File "/usr/local/lib/python3.10/xml/dom/expatbuilder.py", line 129, in _parse_ns_name
raise ValueError("Unsupported syntax: spaces in URIs not supported: %r" % name)
ValueError: Unsupported syntax: spaces in URIs not supported: 'http:abc.com/de f g/hi/j k foo abc'
@vfazio, system expat which isn't truly any upstream version but a series of cherry-picked patches on an old version, is not something upstream Python is able to support. In this case you should be using your distribution's Python to get an internally consistent state.
@vfazio, system expat which isn't truly any upstream version but a series of cherry-picked patches on an old version, is not something upstream Python is able to support. In this case you should be using your distribution's Python to get an internally consistent state.
@ambv Using a distribution's package isn't always feasible, especially if there's no port for the latest upstream version (Debian Bullseye does not provide 3.10.x) so many people will compile their own. A number of places document configuring --with-system-expat to take advantage of the system provided library to receive security updates vs using CPython's in-tree version.
I'm just calling out that people may see these tests fail if they built Python to leverage the external libraries
Activity
hartwork commentedon Feb 20, 2022
It has been reported at https://bugs.python.org/issue46794#msg413587 that the current CPython test suite needs some adjustments for Expat >=2.4.5. Since that is somewhat separate from updating the bundled copy of Expat to >=2.4.6, I am creating this dedicated ticket. I pull request for discussion will follow shortly.
ambv commentedon Feb 21, 2022
New changeset 2cae938 by Sebastian Pipping in branch 'main':
bpo-46811: Make test suite support Expat >=2.4.5 (GH-31453)
2cae938
ambv commentedon Feb 21, 2022
New changeset 7da97f6 by Miss Islington (bot) in branch '3.10':
bpo-46811: Make test suite support Expat >=2.4.5 (GH-31453) (GH-31472)
7da97f6
ambv commentedon Feb 21, 2022
New changeset 336a916 by Miss Islington (bot) in branch '3.9':
bpo-46811: Make test suite support Expat >=2.4.5 (GH-31453) (GH-31469)
336a916
ned-deily commentedon Feb 21, 2022
New changeset d4f5bb9 by Miss Islington (bot) in branch '3.7':
bpo-46811: Make test suite support Expat >=2.4.5 (GH-31453) (GH-31471)
d4f5bb9
ambv commentedon Feb 22, 2022
New changeset fdfd7a9 by Łukasz Langa (Sebastian Pipping) in branch '3.8':
bpo-46811: Make test suite support Expat >=2.4.5 (GH-31453)
fdfd7a9
vfazio commentedon Apr 18, 2022
If python is built to use the system libexpat, the version check used in the listed PRs will not necessarily be effective if the distribution ports patches back:
ambv commentedon Apr 19, 2022
@vfazio, system expat which isn't truly any upstream version but a series of cherry-picked patches on an old version, is not something upstream Python is able to support. In this case you should be using your distribution's Python to get an internally consistent state.
vfazio commentedon Apr 19, 2022
@ambv Using a distribution's package isn't always feasible, especially if there's no port for the latest upstream version (Debian Bullseye does not provide 3.10.x) so many people will compile their own. A number of places document configuring
--with-system-expatto take advantage of the system provided library to receive security updates vs using CPython's in-tree version.I'm just calling out that people may see these tests fail if they built Python to leverage the external libraries
hartwork commentedon Feb 11, 2024
With all the linked pull requests merged, should this issue be closed as fixed?