Accepting request 1084794 from home:david.anes:home:libxml2

- Add patch skip-test-under-libxml2-2.11.1.patch:
  * Skip a test if using libxml2 >= 2.11.1

OBS-URL: https://build.opensuse.org/request/show/1084794
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lxml?expand=0&rev=181
This commit is contained in:
Dirk Mueller 2023-05-04 16:51:26 +00:00 committed by Git OBS Bridge
parent 5efd90fd4d
commit 364711776d
3 changed files with 29 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu May 4 14:52:53 UTC 2023 - David Anes <david.anes@suse.com>
- Add patch skip-test-under-libxml2-2.11.1.patch:
* Skip a test if using libxml2 >= 2.11.1
-------------------------------------------------------------------
Sun Apr 23 23:11:01 UTC 2023 - Matej Cepl <mcepl@suse.com>

View File

@ -33,6 +33,9 @@ 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
BuildRequires: %{python_module Cython >= 0.29.7}
BuildRequires: %{python_module base}
BuildRequires: %{python_module cssselect >= 0.9.1}

View File

@ -0,0 +1,20 @@
Index: lxml-4.9.2/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 (
read_file, write_to_file, BytesIO, tmpfile
)
+import lxml
class _IOTestCaseBase(HelperTestCase):
"""(c)ElementTree compatibility for IO functions/methods
@@ -304,6 +305,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')
uxml = '<?xml version="1.0" encoding="UTF-16"?><p>%s</p>' % utext