diff --git a/ISO-Schematron-schema-optional.patch b/ISO-Schematron-schema-optional.patch deleted file mode 100644 index 4c7bd46..0000000 --- a/ISO-Schematron-schema-optional.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 4bfab2c821961fb4c5ed8a04e329778c9b09a1df Mon Sep 17 00:00:00 2001 -From: Stefan Behnel -Date: Wed, 12 Jul 2023 16:59:07 +0200 -Subject: [PATCH] Make the validation of ISO-Schematron files optional in lxml, - depending on the availability of the RNG validation file. Some lxml - distributions discard the validation schema file due to licensing issues. - -See https://bugs.launchpad.net/lxml/+bug/2024343 ---- - CHANGES.txt | 8 ++++++++ - doc/validation.txt | 9 +++++++++ - src/lxml/isoschematron/__init__.py | 24 +++++++++++++++++++----- - 3 files changed, 36 insertions(+), 5 deletions(-) - -Index: lxml-4.9.3/CHANGES.txt -=================================================================== ---- lxml-4.9.3.orig/CHANGES.txt -+++ lxml-4.9.3/CHANGES.txt -@@ -27,6 +27,14 @@ Other changes - * Built with Cython 0.29.36 to adapt to changes in Python 3.12. - - -+* LP#2024343: The validation of the schema file itself is now optional in the -+ ISO-Schematron implementation. This was done because some lxml distributions -+ discard the RNG validation schema file due to licensing issues. The validation -+ can now always be disabled with ``Schematron(..., validate_schema=False)``. -+ It is enabled by default if available and disabled otherwise. The module -+ constant ``lxml.isoschematron.schematron_schema_valid_supported`` can be used -+ to detect whether schema file validation is available. -+ - 4.9.2 (2022-12-13) - ================== - -Index: lxml-4.9.3/doc/validation.txt -=================================================================== ---- lxml-4.9.3.orig/doc/validation.txt -+++ lxml-4.9.3/doc/validation.txt -@@ -615,6 +615,15 @@ The usage of validation phases is a uniq - a very powerful tool e.g. for establishing validation stages or to provide - different validators for different "validation audiences". - -+Note: Some lxml distributions exclude the validation schema file due to licensing issues. -+Since lxml 5.0, the validation of the user provided schema can be disabled with -+``Schematron(..., validate_schema=False)``. -+It is enabled by default if available and disabled otherwise. Previous versions of -+lxml always had it enabled and failed at import time if the file was not available. -+Thus, some distributions chose to remove the entire ISO-Schematron support. -+The module constant ``lxml.isoschematron.schematron_schema_valid_supported`` can be used -+since lxml 5.0 to detect whether schema file validation is available. -+ - (Pre-ISO-Schematron) - -------------------- - -Index: lxml-4.9.3/src/lxml/isoschematron/__init__.py -=================================================================== ---- lxml-4.9.3.orig/src/lxml/isoschematron/__init__.py -+++ lxml-4.9.3/src/lxml/isoschematron/__init__.py -@@ -61,10 +61,16 @@ iso_svrl_for_xslt1 = _etree.XSLT(_etree. - svrl_validation_errors = _etree.XPath( - '//svrl:failed-assert', namespaces={'svrl': SVRL_NS}) - -- - # RelaxNG validator for schematron schemas --schematron_schema_valid = _etree.RelaxNG( -- file=os.path.join(_resources_dir, 'rng', 'iso-schematron.rng')) -+schematron_schema_valid_supported = False -+try: -+ schematron_schema_valid = _etree.RelaxNG( -+ file=os.path.join(_resources_dir, 'rng', 'iso-schematron.rng')) -+ schematron_schema_valid_supported = True -+except _etree.RelaxNGParseError: -+ # Some distributions delete the file due to licensing issues. -+ def schematron_schema_valid(arg): -+ raise NotImplementedError("Validating the ISO schematron requires iso-schematron.rng") - - - def stylesheet_params(**kwargs): -@@ -153,6 +159,13 @@ class Schematron(_etree._Validator): - report document gets stored and can be accessed as the ``validation_report`` - property. - -+ If ``validate_schema`` is set to False, the validation of the schema file -+ itself is disabled. Validation happens by default after building the full -+ schema, unless the schema validation file cannot be found at import time, -+ in which case the validation gets disabled. Some lxml distributions exclude -+ this file due to licensing issues. ISO-Schematron validation can then still -+ be used normally, but the schemas themselves cannot be validated. -+ - Here is a usage example:: - - >>> from lxml import etree -@@ -234,7 +247,8 @@ class Schematron(_etree._Validator): - def __init__(self, etree=None, file=None, include=True, expand=True, - include_params={}, expand_params={}, compile_params={}, - store_schematron=False, store_xslt=False, store_report=False, -- phase=None, error_finder=ASSERTS_ONLY): -+ phase=None, error_finder=ASSERTS_ONLY, -+ validate_schema=schematron_schema_valid_supported): - super(Schematron, self).__init__() - - self._store_report = store_report -@@ -273,7 +287,7 @@ class Schematron(_etree._Validator): - schematron = self._include(schematron, **include_params) - if expand: - schematron = self._expand(schematron, **expand_params) -- if not schematron_schema_valid(schematron): -+ if validate_schema and not schematron_schema_valid(schematron): - raise _etree.SchematronParseError( - "invalid schematron schema: %s" % - schematron_schema_valid.error_log) diff --git a/close_file_before_test.patch b/close_file_before_test.patch deleted file mode 100644 index c50bdfe..0000000 --- a/close_file_before_test.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- - src/lxml/tests/test_etree.py | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - ---- a/src/lxml/tests/test_etree.py -+++ b/src/lxml/tests/test_etree.py -@@ -18,6 +18,7 @@ import re - import gc - import operator - import textwrap -+import tempfile - import zlib - import gzip - -@@ -5276,9 +5277,11 @@ class ETreeWriteTestCase(HelperTestCase) - - def test_write_file_gzip_parse(self): - tree = self.parse(_bytes(''+''*200+'')) -- with tmpfile() as filename: -- tree.write(filename, compression=9) -- data = etree.tostring(etree.parse(filename)) -+ with tempfile.NamedTemporaryFile() as f: -+ tree.write(f.name, compression=9) -+ f.file.flush() -+ f.file.seek(0) -+ data = etree.tostring(etree.parse(f.name)) - self.assertEqual(_bytes(''+''*200+''), - data) - diff --git a/lxml-4.9.3.tar.gz b/lxml-4.9.3.tar.gz deleted file mode 100644 index c3fc711..0000000 --- a/lxml-4.9.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:48628bd53a426c9eb9bc066a923acaa0878d1e86129fd5359aee99285f4eed9c -size 3572158 diff --git a/lxml-5.1.0.tar.gz b/lxml-5.1.0.tar.gz new file mode 100644 index 0000000..5dcb371 --- /dev/null +++ b/lxml-5.1.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3eea6ed6e6c918e468e693c41ef07f3c3acc310b70ddd9cc72d9ef84bc9564ca +size 3839638 diff --git a/python-lxml.changes b/python-lxml.changes index 9e545f8..4c1aa16 100644 --- a/python-lxml.changes +++ b/python-lxml.changes @@ -1,8 +1,48 @@ +------------------------------------------------------------------- +Thu Feb 15 08:59:28 UTC 2024 - Daniel Garcia + +- Add skip-test-under-libexpat-2.6.0.patch to skip broken test with + expat 2.6.0, gh#python/cpython#115133 + +------------------------------------------------------------------- +Wed Jan 24 10:53:21 UTC 2024 - ecsos + +- Fix build error for Leap. + Use build and test as descriped on upstream. + +------------------------------------------------------------------- +Sun Jan 14 10:00:32 UTC 2024 - Adrian Schröter + +- update to version 5.1.0: + Details on https://lxml.de/5.1/changes-5.1.0.html + removed merged patches: + - ISO-Schematron-schema-optional.patch + - remove-ISO-Schematron-schema.patch + - close_file_before_test.patch + +------------------------------------------------------------------- +Wed Dec 20 22:04:14 UTC 2023 - Dirk Müller + +- update to 4.9.4: + * LP#2046398: Inserting/replacing an ancestor into a node's + children could loop indefinitely. + * LP#1980767, GH#379: ``TreeBuilder.close()`` could fail with a + ``TypeError`` after parsing incorrect input. + * LP#1522052: A file-system specific test is now optional and + should no longer fail on systems that don't support it. + * Built with Cython 0.29.37. +- drop libxml2212-tests.patch (upstream) + +------------------------------------------------------------------- +Mon Nov 27 12:36:51 UTC 2023 - Markéta Machová + +- Add libxml2212-tests.patch to fix tests with new libxml2 + ------------------------------------------------------------------- Wed Sep 6 20:04:29 UTC 2023 - Dirk Müller - skip html5lib tests - cyclic dependency with html5lib tests -- remove python 2.x from testing +- remove python 2.x from testing ------------------------------------------------------------------- Sun Aug 13 18:55:19 UTC 2023 - Dirk Müller @@ -54,7 +94,7 @@ Thu Apr 13 22:42:31 UTC 2023 - Matej Cepl ------------------------------------------------------------------- Thu Feb 16 20:17:22 UTC 2023 - Dirk Müller -- allow building against any libxml2 version in sle15 +- allow building against any libxml2 version in sle15 ------------------------------------------------------------------- Fri Jan 20 16:00:15 UTC 2023 - Matej Cepl @@ -108,7 +148,7 @@ Fri Feb 18 00:36:08 UTC 2022 - Dirk Müller override the default namespace of the factory. * GH#338: In lxml.objectify, the XSI float annotation "nan" and "inf" were spelled in lower case, whereas XML Schema datatypes define them as "NaN" and "INF" respectively. - * Built with Cython 0.29.28. + * Built with Cython 0.29.28. ------------------------------------------------------------------- Mon Jan 10 23:09:05 UTC 2022 - Dirk Müller @@ -227,7 +267,7 @@ Thu Mar 5 12:44:43 UTC 2020 - Ondřej Súkup Wed Jan 22 13:55:03 UTC 2020 - Martin Sirringhaus - Update to 4.4.2: - * LP#1835708: ElementInclude incorrectly rejected repeated + * LP#1835708: ElementInclude incorrectly rejected repeated non-recursive includes as recursive. * Remove patch lxml-libxml-2.9.10.patch which is now upstream @@ -368,7 +408,7 @@ Tue Aug 7 15:34:31 UTC 2018 - toddrme2178@gmail.com Wed Mar 28 17:05:30 UTC 2018 - hpj@urpla.net - Version update to 4.2.1: - * LP#1755825: iterwalk() failed to return the 'start' event for the initial + * LP#1755825: iterwalk() failed to return the 'start' event for the initial element if a tag selector is used. * LP#1756314: Failure to import 4.2.0 into PyPy due to a missing library symbol. * LP#1727864, GH#258: Add "-isysroot" linker option on MacOS as needed by XCode 9. @@ -467,37 +507,37 @@ Fri Jul 28 17:24:27 UTC 2017 - ecsos@opensuse.org - update to 3.8.0 Features added - - ElementTree.write() has a new option doctype that writes out - a doctype string before the serialisation, in the same way as + - ElementTree.write() has a new option doctype that writes out + a doctype string before the serialisation, in the same way as tostring(). - - GH#220: xmlfile allows switching output methods at an element + - GH#220: xmlfile allows switching output methods at an element level. Patch by Burak Arslan. - - LP#1595781, GH#240: added a PyCapsule Python API and C-level - API for passing externally generated libxml2 documents into + - LP#1595781, GH#240: added a PyCapsule Python API and C-level + API for passing externally generated libxml2 documents into lxml. - - GH#244: error log entries have a new property path with an - XPath expression (if known, None otherwise) that points to the + - GH#244: error log entries have a new property path with an + XPath expression (if known, None otherwise) that points to the tree element responsible for the error. Patch by Bob Kline. - - The namespace prefix mapping that can be used in ElementPath + - The namespace prefix mapping that can be used in ElementPath now injects a default namespace when passing a None prefix. Bugs fixed - - GH#238: Character escapes were not hex-encoded in the xmlfile + - GH#238: Character escapes were not hex-encoded in the xmlfile serialiser. Patch by matejcik. - - GH#229: fix for externally created XML documents. + - GH#229: fix for externally created XML documents. Patch by Theodore Dubois. - LP#1665241, GH#228: Form data handling in lxml.html no longer - strips the option values specified in form attributes but only + strips the option values specified in form attributes but only the text values. Patch by Ashish Kulkarni. - - LP#1551797: revert previous fix for XSLT error logging as it + - LP#1551797: revert previous fix for XSLT error logging as it breaks multi-threaded XSLT processing. - - LP#1673355, GH#233: fromstring() html5parser failed to parse + - LP#1673355, GH#233: fromstring() html5parser failed to parse byte strings. Other changes - - The previously undocumented docstring option in - ElementTree.write() produces a deprecation warning and will + - The previously undocumented docstring option in + ElementTree.write() produces a deprecation warning and will eventually be removed. - enable source url for pdf doc -- remove patch lxml-fix-attribute-quoting.patch because it is now +- remove patch lxml-fix-attribute-quoting.patch because it is now in upstream ------------------------------------------------------------------- @@ -730,14 +770,14 @@ Thu Apr 24 06:48:15 UTC 2014 - toms@opensuse.org ** Features added n/a ** Bugs fixed - - HTML cleaning could fail to strip javascript links that mix + - HTML cleaning could fail to strip javascript links that mix control characters into the link scheme. ** Other changes n/a - Changes in version 3.3.4: ** Features added - - Source line numbers above 65535 are available on Elements when + - Source line numbers above 65535 are available on Elements when using libxml2 2.9 or later. ** Bugs fixed - lxml.html.fragment_fromstring() failed for bytes input in Py3. @@ -789,9 +829,9 @@ Sat Feb 22 10:33:42 UTC 2014 - toms@opensuse.org ** Features added n/a ** Bugs fixed - - LP#1014290: HTML documents parsed with parser.feed() failed to + - LP#1014290: HTML documents parsed with parser.feed() failed to find elements during tag iteration. - - LP#1273709: Building in PyPy failed due to missing support for + - LP#1273709: Building in PyPy failed due to missing support for PyUnicode_Compare() and PyByteArray_*() in PyPy's C-API. - LP#1274413: Compilation in MSVC failed due to missing "stdint.h" standard header file. @@ -820,21 +860,21 @@ Sun Jan 26 13:02:19 UTC 2014 - toms@opensuse.org ** Features added n/a ** Bugs fixed - - The heuristic that distinguishes file paths from URLs was + - The heuristic that distinguishes file paths from URLs was tightened to produce less false negatives. - Changes from 3.3.0beta5 ** Features added - - The PEP 393 unicode parsing support gained a fallback for + - The PEP 393 unicode parsing support gained a fallback for wchar strings which might still be somewhat common on Windows systems. ** Bugs fixed - - Several error handling problems were fixed throughout the code base - that could previously lead to exceptions being silently swallowed or + - Several error handling problems were fixed throughout the code base + that could previously lead to exceptions being silently swallowed or not properly reported. - - The C-API function appendChild() is now deprecated as it does not - propagate exceptions (its return type is void). The new function + - The C-API function appendChild() is now deprecated as it does not + propagate exceptions (its return type is void). The new function appendChildToElement() was added as a safe replacement. - - Passing a string into fromstringlist() raises an exception instead of + - Passing a string into fromstringlist() raises an exception instead of parsing the string character by character. ** Other changes diff --git a/python-lxml.spec b/python-lxml.spec index 701e648..4c01571 100644 --- a/python-lxml.spec +++ b/python-lxml.spec @@ -1,7 +1,7 @@ # # spec file for package python-lxml # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-lxml -Version: 4.9.3 +Version: 5.1.0 Release: 0 Summary: Pythonic XML processing library License: BSD-3-Clause AND GPL-2.0-or-later @@ -27,22 +27,16 @@ URL: https://lxml.de/ Source0: https://files.pythonhosted.org/packages/source/l/lxml/lxml-%{version}.tar.gz Source1: https://lxml.de/lxmldoc-4.5.2.pdf Source99: python-lxml.rpmlintrc -# PATCH-FIX-UPSTREAM close_file_before_test.patch bsc#1206555 mcepl@suse.com -# make sure the testing data are flushed to the file -Patch0: close_file_before_test.patch # PATCH-FIX-OPENSUSE Skip a test under libxml2 2.10.4+ # https://bugs.launchpad.net/lxml/+bug/2016939 Patch1: skip-test-under-libxml2-2.10.4.patch # PATCH-FIX-OPENSUSE Skip a test under libxml2 2.11.1+ # https://bugs.launchpad.net/lxml/+bug/2018522 Patch2: skip-test-under-libxml2-2.11.1.patch -# PATCH-FIX-UPSTREAM ISO-Schematron-schema-optional.patch lp#2024343 mcepl@suse.com -# Make ISO Schematron RNG validation schemes optional and then remove it gh#lxml/lxml@4bfab2c82196 -Patch3: ISO-Schematron-schema-optional.patch -# PATCH-FIX-UPSTREAM remove-ISO-Schematron-schema.patch gl#fedora/legal/fedora-license-data/-#154 mcepl@suse.com -# Actually remove the schema -Patch4: remove-ISO-Schematron-schema.patch -BuildRequires: %{python_module Cython >= 0.29.7 with %python-Cython < 3} +# PATCH-FIX-OPENSUSE Skip a test under libexpat 2.6.0+ +# Same test gh#python/cpython#115133 +Patch3: skip-test-under-libexpat-2.6.0.patch +BuildRequires: %{python_module Cython >= 3.0.7} BuildRequires: %{python_module base} BuildRequires: %{python_module cssselect >= 0.9.1} BuildRequires: %{python_module setuptools >= 18.0.1} @@ -104,7 +98,7 @@ rm src/lxml/lxml.etree_api.h %build export CFLAGS="%{optflags}" -%python_build --with-cython +%python_build build_ext -i --with-cython %check # The tests fail on SLE 11 due to broken incremental parsing in libxml2 @@ -113,7 +107,7 @@ export LANG=en_US.UTF-8 export PYTHONUNBUFFERED=x # cyclic dependency between html5lib and lxml rm -v src/lxml/html/tests/test_html5parser.py -%{python_expand PYTHON3="$python" %make_build test3} +%python_exec test.py %install %python_install diff --git a/remove-ISO-Schematron-schema.patch b/remove-ISO-Schematron-schema.patch deleted file mode 100644 index 1bba569..0000000 --- a/remove-ISO-Schematron-schema.patch +++ /dev/null @@ -1,731 +0,0 @@ ---- - src/lxml/isoschematron/resources/rng/iso-schematron.rng | 709 ---------------- - src/lxml/tests/test_isoschematron.py | 1 - 2 files changed, 1 insertion(+), 709 deletions(-) - -Index: lxml-4.9.2/src/lxml/isoschematron/resources/rng/iso-schematron.rng -=================================================================== ---- lxml-4.9.2.orig/src/lxml/isoschematron/resources/rng/iso-schematron.rng -+++ /dev/null -@@ -1,709 +0,0 @@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ltr -- rtl -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- true -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- false -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- false -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- true -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- false -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- preserve -- default -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1 -- -- -- -Index: lxml-4.9.2/src/lxml/tests/test_isoschematron.py -=================================================================== ---- lxml-4.9.2.orig/src/lxml/tests/test_isoschematron.py -+++ lxml-4.9.2/src/lxml/tests/test_isoschematron.py -@@ -55,6 +55,7 @@ class ETreeISOSchematronTestCase(HelperT - schema = isoschematron.Schematron(schema) - self.assertTrue(schema) - -+ @unittest.skip("No RNG schema present, validation is not possible.") - def test_schematron_invalid_schema_empty(self): - schema = self.parse('''\ - diff --git a/skip-test-under-libexpat-2.6.0.patch b/skip-test-under-libexpat-2.6.0.patch new file mode 100644 index 0000000..183374b --- /dev/null +++ b/skip-test-under-libexpat-2.6.0.patch @@ -0,0 +1,16 @@ +Index: lxml-5.1.0/src/lxml/tests/test_elementtree.py +=================================================================== +--- lxml-5.1.0.orig/src/lxml/tests/test_elementtree.py ++++ lxml-5.1.0/src/lxml/tests/test_elementtree.py +@@ -4383,8 +4383,10 @@ class _XMLPullParserTest(unittest.TestCa + self.assertEqual([(action, elem.tag) for action, elem in events], + expected) + ++ # Fails with chunk_size in [1, 5], so replacing with 22, ++ # gh#python/cpython#115289 + def test_simple_xml(self): +- for chunk_size in (None, 1, 5): ++ for chunk_size in (None, 22): + #with self.subTest(chunk_size=chunk_size): + parser = self.etree.XMLPullParser() + self.assert_event_tags(parser, []) diff --git a/skip-test-under-libxml2-2.10.4.patch b/skip-test-under-libxml2-2.10.4.patch index d3fb77d..ce944ab 100644 --- a/skip-test-under-libxml2-2.10.4.patch +++ b/skip-test-under-libxml2-2.10.4.patch @@ -1,12 +1,12 @@ -Index: lxml-4.9.2/src/lxml/tests/test_etree.py +Index: lxml-5.1.0/src/lxml/tests/test_etree.py =================================================================== ---- lxml-4.9.2.orig/src/lxml/tests/test_etree.py -+++ lxml-4.9.2/src/lxml/tests/test_etree.py -@@ -3068,6 +3068,7 @@ class ETreeOnlyTestCase(HelperTestCase): +--- lxml-5.1.0.orig/src/lxml/tests/test_etree.py ++++ lxml-5.1.0/src/lxml/tests/test_etree.py +@@ -3256,6 +3256,7 @@ class ETreeOnlyTestCase(HelperTestCase): self.assertEqual(re, e.nsmap) self.assertEqual(r, s.nsmap) + @unittest.skipIf(etree.LIBXML_VERSION >= (2, 10, 4), "libxml2 regression ignores namespaces") def test_html_prefix_nsmap(self): etree = self.etree - el = etree.HTML('aa').find('.//page-description') + el = etree.HTML('aa') diff --git a/skip-test-under-libxml2-2.11.1.patch b/skip-test-under-libxml2-2.11.1.patch index 1139722..11492ab 100644 --- a/skip-test-under-libxml2-2.11.1.patch +++ b/skip-test-under-libxml2-2.11.1.patch @@ -1,8 +1,8 @@ -Index: lxml-4.9.2/src/lxml/tests/test_io.py +Index: lxml-5.1.0/src/lxml/tests/test_io.py =================================================================== ---- lxml-4.9.2.orig/src/lxml/tests/test_io.py -+++ lxml-4.9.2/src/lxml/tests/test_io.py -@@ -15,6 +15,7 @@ from .common_imports import ( +--- lxml-5.1.0.orig/src/lxml/tests/test_io.py ++++ lxml-5.1.0/src/lxml/tests/test_io.py +@@ -12,6 +12,7 @@ from .common_imports import ( read_file, write_to_file, BytesIO, tmpfile ) @@ -10,11 +10,11 @@ Index: lxml-4.9.2/src/lxml/tests/test_io.py class _IOTestCaseBase(HelperTestCase): """(c)ElementTree compatibility for IO functions/methods -@@ -304,6 +305,7 @@ class _IOTestCaseBase(HelperTestCase): +@@ -305,6 +306,7 @@ class _IOTestCaseBase(HelperTestCase): os.unlink(f.name) self.assertEqual(utext, root.text) + @unittest.skipIf(lxml.etree.LIBXML_VERSION >= (2, 11, 1), "libxml2 regression has issues with utf16") def test_iterparse_utf16_bom(self): - utext = _str('Søk på nettet') + utext = 'Søk på nettet' uxml = '

%s

' % utext