- 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)
- remove python 2.x from testing
- allow building against any libxml2 version in sle15
  * Built with Cython 0.29.28.
  * LP#1835708: ElementInclude incorrectly rejected repeated
  * LP#1755825: iterwalk() failed to return the 'start' event for the initial
  - ElementTree.write() has a new option doctype that writes out
    a doctype string before the serialisation, in the same way as
  - GH#220: xmlfile allows switching output methods at an element
  - LP#1595781, GH#240: added a PyCapsule Python API and C-level
    API for passing externally generated libxml2 documents into
  - GH#244: error log entries have a new property path with an
    XPath expression (if known, None otherwise) that points to the
  - The namespace prefix mapping that can be used in ElementPath
  - GH#238: Character escapes were not hex-encoded in the xmlfile
  - GH#229: fix for externally created XML documents.
    strips the option values specified in form attributes but only
  - LP#1551797: revert previous fix for XSLT error logging as it
  - LP#1673355, GH#233: fromstring() html5parser failed to parse
  - The previously undocumented docstring option in
    ElementTree.write() produces a deprecation warning and will
- remove patch lxml-fix-attribute-quoting.patch because it is now

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lxml?expand=0&rev=191
This commit is contained in:
Dirk Mueller 2023-12-20 22:05:16 +00:00 committed by Git OBS Bridge
parent 81aa3f39a0
commit 0d1ac9e9a0
5 changed files with 49 additions and 80 deletions

View File

@ -1,41 +0,0 @@
From 2a6770566ab57d601abc7c2f49a8051b9d97b64c Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Tue, 31 Oct 2023 12:36:02 +0100
Subject: [PATCH] Make Unicode recovery test work with libxml2 2.12 (GH-383)
When encountering encoding errors, libxml2 no longer switches to ISO-8859-1 since version 2.12.
---
src/lxml/parser.pxi | 2 +-
src/lxml/tests/test_unicode.py | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/lxml/parser.pxi b/src/lxml/parser.pxi
index 4b7b52065..8ceec7d25 100644
--- a/src/lxml/parser.pxi
+++ b/src/lxml/parser.pxi
@@ -693,7 +693,7 @@ cdef xmlDoc* _handleParseResult(_ParserContext context,
# An encoding error occurred and libxml2 switched from UTF-8
# input to (undecoded) Latin-1, at some arbitrary point in the
# document. Better raise an error than allowing for a broken
- # tree with mixed encodings.
+ # tree with mixed encodings. This is fixed in libxml2 2.12.
well_formed = 0
elif recover or (c_ctxt.wellFormed and
c_ctxt.lastError.level < xmlerror.XML_ERR_ERROR):
diff --git a/src/lxml/tests/test_unicode.py b/src/lxml/tests/test_unicode.py
index 6d4ee9c0f..3636539b2 100644
--- a/src/lxml/tests/test_unicode.py
+++ b/src/lxml/tests/test_unicode.py
@@ -167,7 +167,11 @@ def test_illegal_utf8(self):
def test_illegal_utf8_recover(self):
data = _bytes('<test>\x80\x80\x80</test>', encoding='iso8859-1')
parser = etree.XMLParser(recover=True)
- self.assertRaises(etree.XMLSyntaxError, etree.fromstring, data, parser)
+ if etree.LIBXML_VERSION >= (2, 12, 0):
+ tree = etree.fromstring(data, parser)
+ self.assertEqual('\ufffd\ufffd\ufffd', tree.text)
+ else:
+ self.assertRaises(etree.XMLSyntaxError, etree.fromstring, data, parser)
def _test_encoding(self, encoding, xml_encoding_name=None):
foo = """<?xml version='1.0' encoding='%s'?>\n<tag attrib='123'></tag>""" % (

BIN
lxml-4.9.3.tar.gz (Stored with Git LFS)

Binary file not shown.

3
lxml-4.9.4.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b1541e50b78e15fa06a2670157a1962ef06591d4c998b998047fff5e3236880e
size 3576664

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Wed Dec 20 22:04:14 UTC 2023 - Dirk Müller <dmueller@suse.com>
- 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á <mmachova@suse.com>

View File

@ -18,7 +18,7 @@
%{?sle15_python_module_pythons}
Name: python-lxml
Version: 4.9.3
Version: 4.9.4
Release: 0
Summary: Pythonic XML processing library
License: BSD-3-Clause AND GPL-2.0-or-later
@ -42,9 +42,6 @@ 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
# PATCH-FIX-UPSTREAM libxml2212-tests.patch https://github.com/lxml/lxml/pull/383
# Make Unicode recovery test work with upcoming libxml2 2.12
Patch5: libxml2212-tests.patch
BuildRequires: %{python_module Cython >= 0.29.7 with %python-Cython < 3}
BuildRequires: %{python_module base}
BuildRequires: %{python_module cssselect >= 0.9.1}