html5lib-1.1 build failure with Python 3.14

"Stephen Berman" ([email protected] via blfs-dev Mailing List) <[email protected]> Tue, 28 Oct 2025 23:13:37 +0100
Newsgroups gmane.linux.lfs.beyond.devel
Message-ID <[email protected]>
Building html5lib in current BLFS with Python 3.14 fails:

 File "/sources/html5lib/html5lib-1.1/setup.py", line 93, in <module>
      isinstance(a.value, ast.Str)):
                              ^^^^^^^
 AttributeError: module 'ast' has no attribute 'Str'

This is because the 'Str' attribute was removed in 3.14
<https://docs.python.org/dev/whatsnew/3.14.html#id2>.  There is a patch
at <https://github.com/html5lib/html5lib-python/pull/589/files>, which
AFAICT is not yet in a tagged version of html5lib.  From this patch I
constructed the following two seds and with them could complete the
build:

sed -i 's/isinstance(a.value, ast.Str)):/isinstance(a.value, ast.Constant) and\
                isinstance(a.value.value, str)):/' setup.py
sed -i 's/a.value.s/a.value.value/' setup.py 

I added the space at the beginning of the second line of the first sed
to get the right indentation.  My sed-foo is minimal so there's no doubt
better alternatives, but this worked for me.

Steve Berman

-- 
http://lists.linuxfromscratch.org/sympa/info/blfs-dev
Unsubscribe: See the above information page