I've tested that patch and with libxml 2.12.3 I have pytaest failing unit + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-beautifulsoup4-4.12.2-6.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-beautifulsoup4-4.12.2-6. + /usr/bin/pytest -ra -m 'not network' ============================= test session starts ============================== platform linux -- Python 3.8.18, pytest-7.4.3, pluggy-1.3.0 rootdir: /home/tkloczko/rpmbuild/BUILD/beautifulsoup4-4.12.2 collected 656 items bs4/tests/test_builder.py ..... [ 0%] bs4/tests/test_builder_registry.py ........... [ 2%] bs4/tests/test_css.py .................................................. [ 10%] .......... [ 11%] bs4/tests/test_dammit.py .................................. [ 16%] bs4/tests/test_element.py ..... [ 17%] bs4/tests/test_formatter.py .............. [ 19%] bs4/tests/test_fuzz.py .....ssssss [ 21%] bs4/tests/test_html5lib.py ............................................. [ 28%] ...................................... [ 33%] bs4/tests/test_htmlparser.py ........................................... [ 40%] ...........F.................... [ 45%] bs4/tests/test_lxml.py ................................................. [ 52%] .................................................... [ 60%] bs4/tests/test_navigablestring.py ........ [ 62%] bs4/tests/test_pageelement.py .................................... [ 67%] bs4/tests/test_soup.py ................................................. [ 75%] ......... [ 76%] bs4/tests/test_tag.py ....................... [ 79%] bs4/tests/test_tree.py ................................................. [ 87%] ........................................................................ [ 98%] ........... [100%] =================================== FAILURES =================================== _____ TestHTMLParserTreeBuilder.test_smart_quotes_converted_on_the_way_in ______ self = def test_smart_quotes_converted_on_the_way_in(self): # Microsoft smart quotes are converted to Unicode characters during # parsing. quote = b"

\x91Foo\x92

" soup = self.soup(quote) > assert soup.p.string == "\N{LEFT SINGLE QUOTATION MARK}Foo\N{RIGHT SINGLE QUOTATION MARK}" E AttributeError: 'NoneType' object has no attribute 'string' bs4/tests/__init__.py:808: AttributeError =========================== short test summary info ============================ SKIPPED [6] bs4/tests/test_fuzz.py:60: html5lib problems FAILED bs4/tests/test_htmlparser.py::TestHTMLParserTreeBuilder::test_smart_quotes_converted_on_the_way_in =================== 1 failed, 649 passed, 6 skipped in 4.23s ===================