Update to 4.9.4 (rhbz#2255267)

This commit is contained in:
Lumir Balhar 2023-12-20 13:41:58 +01:00
parent e20963f4cf
commit 63254d5e35
5 changed files with 22 additions and 63 deletions

1
.gitignore vendored
View File

@ -62,3 +62,4 @@ lxml-2.2.7.tar.gz.asc
/lxml-4.9.2-no-isoschematron.tar.gz
/lxml-4.9.2-no-isoschematron-rng.tar.gz
/lxml-4.9.3-no-isoschematron-rng.tar.gz
/lxml-4.9.4-no-isoschematron-rng.tar.gz

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>""" % (

View File

@ -1,28 +1,25 @@
From a500f721e3b34018f0a86af275427663dc337b5a Mon Sep 17 00:00:00 2001
From 07b3e9915972be02fbe98ab68ac052136ea94e27 Mon Sep 17 00:00:00 2001
From: Stefan Behnel <stefan_ml@behnel.de>
Date: Wed, 12 Jul 2023 16:59:07 +0200
Date: Wed, 20 Dec 2023 12:53:02 +0100
Subject: [PATCH] Make the validation of ISO-Schematron files optional in lxml,
depending on the availability of the RNG validation file. Some 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 | 11 +++++++++++
CHANGES.txt | 7 +++++++
doc/validation.txt | 9 +++++++++
src/lxml/isoschematron/__init__.py | 24 +++++++++++++++++++-----
3 files changed, 39 insertions(+), 5 deletions(-)
3 files changed, 35 insertions(+), 5 deletions(-)
diff --git a/CHANGES.txt b/CHANGES.txt
index 24052db..e68ee9a 100644
index 4dd1055..90b3329 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -2,6 +2,17 @@
lxml changelog
==============
@@ -49,6 +49,13 @@ Other changes
* Built with Cython 0.29.36 to adapt to changes in Python 3.12.
+4.9.3+
+======
+
+* 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
@ -30,10 +27,9 @@ index 24052db..e68ee9a 100644
+ 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.3 (2023-07-05)
==================
4.9.2 (2022-12-13)
==================
diff --git a/doc/validation.txt b/doc/validation.txt
index af9d007..27c0ccd 100644
--- a/doc/validation.txt
@ -112,5 +108,5 @@ index 5967b10..2846a66 100644
"invalid schematron schema: %s" %
schematron_schema_valid.error_log)
--
2.40.1
2.43.0

View File

@ -1,6 +1,6 @@
Name: python-lxml
Version: 4.9.3
Release: 4%{?dist}
Version: 4.9.4
Release: 1%{?dist}
Summary: XML processing library combining libxml2/libxslt with the ElementTree API
# The lxml project is licensed under BSD-3-Clause
@ -35,9 +35,6 @@ Patch: https://github.com/lxml/lxml/commit/a03a4b3c6b906d33c5ef1a15f3d5
Patch: https://github.com/lxml/lxml/commit/34187968a67151f02db491a56a0037b55319931d.patch
Patch: https://github.com/lxml/lxml/commit/98025653e182f9203189cbde0ab2d6ebec556db8.patch
# libxml2 2.12.0 Unicode test compatibility
Patch: https://github.com/lxml/lxml/commit/2a6770566ab57d601abc7c2f49a8051b9d97b64c.patch
BuildRequires: gcc
BuildRequires: libxml2-devel
BuildRequires: libxslt-devel
@ -80,6 +77,9 @@ Python 3 version.
# Don't run html5lib tests --without extras
%{!?without_extras:rm src/lxml/html/tests/test_html5parser.py}
# Remove limit for version of Cython
sed -i "s/Cython.*/Cython/" requirements.txt
%generate_buildrequires
%pyproject_buildrequires -x source%{?with_extras:,cssselect,html5,htmlsoup}
@ -107,6 +107,9 @@ cp -a build/lib.%{python3_platform}-*/* src/
%doc README.rst
%changelog
* Wed Dec 20 2023 Lumír Balhar <lbalhar@redhat.com> - 4.9.4-1
- Update to 4.9.4 (rhbz#2255267)
* Sun Nov 26 2023 David King <amigadave@amigadave.com> - 4.9.3-4
- Fix building against libxml2 2.12.0
- Resolves: rhbz#2250838

View File

@ -1 +1 @@
SHA512 (lxml-4.9.3-no-isoschematron-rng.tar.gz) = e3e289ad0aa4bec75fbdee5682d1047c2f98f48f9fd39571175f6a758a10ab2266ed4591bf9dcb65a387ee22cf9de4adac57997dca57b95e0bae07268aff33fe
SHA512 (lxml-4.9.4-no-isoschematron-rng.tar.gz) = 0519d6d58537d870fd862fa9f9256cca85162720eb417e2f532d000ab0faf25121b947746517c0a5df56c9d89e5cf5069a3a90f0fe116b2e6378329f2330c8ac