Compare commits

...
Sign in to create a new pull request.

71 commits

Author SHA1 Message Date
Lumir Balhar
11da0f3a63 Update to 6.0.2 (rhbz#2397231) 2025-09-22 12:49:34 +02:00
Python Maint
b2351e3e34 Rebuilt for Python 3.14.0rc3 bytecode 2025-09-19 13:41:18 +02:00
Lumir Balhar
1fd88c3632 Update to 6.0.1 (rhbz#2390283) 2025-08-24 22:22:09 +02:00
Python Maint
86d492aea6 Rebuilt for Python 3.14.0rc2 bytecode 2025-08-15 14:04:47 +02:00
Lumir Balhar
d4c3d0bb6c Fix test_wrap_html with Python 3.14rc1 2025-08-05 13:50:20 +02:00
Fedora Release Engineering
cd4ee3066f Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-25 08:42:31 +00:00
Lumir Balhar
adc8d24589 Update to 6.0.0 (rhbz#2374994) 2025-06-30 11:19:42 +02:00
Python Maint
544488770a Rebuilt for Python 3.14 2025-06-03 12:25:50 +02:00
Python Maint
6df45dce8b Bootstrap for Python 3.14 2025-06-02 21:23:03 +02:00
Lumir Balhar
b9a077ae03 Update to 5.4.0 (rhbz#2361809) 2025-04-23 13:59:36 +02:00
Robert-André Mauchin
b928096276 Update to 5.3.2
Close: rhbz#2357632
2025-04-06 18:29:44 +02:00
Lumir Balhar
c1103ff3c3 Update to 5.3.1 (rhbz#2344609) 2025-02-11 12:10:25 +01:00
Fedora Release Engineering
f75dd54e14 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-18 15:53:28 +00:00
Miro Hrončok
b52ea727c7 Fix build with Python 3.14
- Fixes: rhbz#2335830
2025-01-06 16:21:46 +01:00
Lumir Balhar
afcfecf47d Update to 5.3.0 (rhbz#2303963) 2024-08-12 14:59:25 +02:00
Lumir Balhar
61d79bae8d Fix doctest failing with the latest libxslt (rhbz#2301176) 2024-07-31 11:18:55 +02:00
Fedora Release Engineering
27c594a8e2 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-19 12:55:35 +00:00
Python Maint
58ac417c3e Rebuilt for Python 3.13 2024-06-07 23:20:38 +02:00
Python Maint
39e20da595 Rebuilt for Python 3.13 2024-06-07 20:41:48 +02:00
Python Maint
9579799168 Bootstrap for Python 3.13 2024-06-07 09:50:04 +02:00
Lumir Balhar
dbf7e6096c Update to 5.2.1 (rhbz#2272165) 2024-04-04 15:26:12 +02:00
Miro Hrončok
85c8c3f227 Revert "Reduce the type safety as a workaround for build failures in Fedora 40+"
- The workaround has been moved to Cython

See https://src.fedoraproject.org/rpms/Cython/c/ba710e631b8ecf2af6eb636030db6d574d8575b4

This reverts commit 0f51029568.
2024-03-06 14:39:01 +01:00
Miro Hrončok
23cd3c2e48 Fix test_elementtree with Expat 2.6.0
- Fixes: rhbz#2264859
2024-03-04 09:25:24 +01:00
Miro Hrončok
0f51029568 Reduce the type safety as a workaround for build failures in Fedora 40+
- Fixes: rhbz#2261034
- Fixes: rhbz#2256232
2024-02-07 10:58:36 +01:00
Miro Hrončok
009f7659b7 Convert to %autorelease and %autochangelog
[skip changelog]
2024-01-29 19:14:58 +01:00
Tomas Orsava
e38670104e Fixing whitespace 2024-01-29 10:30:12 +01:00
Fedora Release Engineering
3a10d475bb Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-22 03:09:29 +00:00
Lumir Balhar
db11b56656 Update to 5.1.0 (rhbz#2256232) 2024-01-08 15:29:00 +01:00
Lumir Balhar
63254d5e35 Update to 4.9.4 (rhbz#2255267) 2023-12-20 13:41:58 +01:00
David King
e20963f4cf Fix building against libxml2 2.12.0
Resolves https://bugzilla.redhat.com/show_bug.cgi?id=2250838
2023-11-27 10:16:27 +01:00
Miro Hrončok
9fac0d5501 Python 3.13 compatibility
This only changes the tests.

Fixes https://bugzilla.redhat.com/2247011
2023-11-06 11:43:32 +01:00
Miro Hrončok
3b50336b27 Remove pregenerated Cython C sources in %build
In a future version of mock, %prep will only run once,
which breaks the prior state of this package.

Previously, this only worked because each %prep round restored
the pregenerated files for the setup.py logic to see.

However, when %prep only runs once, the second round of
%pyproject_buildrequires fails unless Cython is already installed,
which is not the default case,
as the dependency has not yet been generated.

See https://github.com/rpm-software-management/mock/pull/1250
2023-10-30 12:43:19 +01:00
Miro Hrončok
55f5648cc5 Fix build with Cython 3 2023-07-28 11:56:41 +02:00
Miro Hrončok
9a245c1e0c Pin Cython < 3 at least until we upgrade to lxml 5+ 2023-07-25 13:55:24 +02:00
Lumir Balhar
79d3d026da Update to 4.9.3 (rhbz#2219811) 2023-07-25 13:40:31 +02:00
Fedora Release Engineering
4452ba9aa0 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-21 11:10:44 +00:00
Miro Hrončok
3c925c366d Only drop the license-problematic file from ISO-Schematron, not the entire module 2023-07-14 12:34:08 +02:00
Python Maint
0e1ee829e6 Rebuilt for Python 3.12 2023-06-16 08:19:17 +02:00
Miro Hrončok
1a4b58646c Don't run html5lib tests --without extras
For unknown reason, the tests fail with:

    ...
      File "/builddir/build/BUILD/lxml-4.9.2/src/lxml/html/tests/test_html5parser.py", line 304, in call_it
        from lxml.html.html5parser import parse
      File "/builddir/build/BUILD/lxml-4.9.2/src/lxml/html/html5parser.py", line 7, in <module>
        from html5lib import HTMLParser as _HTMLParser
    ModuleNotFoundError: No module named 'html5lib'

But only with Python 3.12, not with Python 3.11.
2023-06-14 19:47:00 +02:00
Miro Hrončok
a1fda59562 Avoid using the deprecated "imp" module (removed in Python 3.12) 2023-06-14 18:32:37 +02:00
Python Maint
4391bca196 Bootstrap for Python 3.12 2023-06-13 21:36:20 +02:00
Miro Hrončok
9d95f5a04e Remove the isoschematron submodule
See https://gitlab.com/fedora/legal/fedora-license-data/-/issues/154

Cherry-picked from 7f6d5f61df

Co-Authored-By: Charalampos Stratakis <cstratak@redhat.com>
2023-06-08 08:48:36 +00:00
Miro Hrončok
af2ab59687 Rework the extras bcond to control the entire extras feature 2023-05-30 22:29:46 +02:00
Yaakov Selkowitz
e3db9bc24a Disable extras in RHEL builds
The `buildrequire_extras` dependencies are unwanted in RHEL.
2023-05-30 15:07:19 -04:00
Tomáš Hrnčiar
26d49d1f7e Skip failing test to avoid FTBFS 2023-05-29 16:06:27 +02:00
Fedora Release Engineering
1c38e85b1f Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-20 14:31:02 +00:00
Lumir Balhar
7b1e5f9aab Update to 4.9.2 (rhbz#2153063) 2022-12-14 17:59:24 +01:00
Miro Hrončok
9c1438f59e Define a buildrequire_extras %bcond for bootstrapping 2022-09-21 14:33:34 +02:00
Charalampos Stratakis
8cd3405121 Update to 4.9.1
Fix for CVE-2022-2309

Resolves: rhbz#2107571, rhbz#2110131
2022-09-15 00:01:08 +02:00
Miro Hrončok
0a54307e77 Convert package to %pyproject RPM macros 2022-08-31 12:07:04 +02:00
Miro Hrončok
eb057e7afa Drop redundant source number 2022-08-31 11:44:07 +02:00
Miro Hrončok
e45c54553a Package the lxml[cssselect], lxml[html5] and lxml[htmlsoup] extras 2022-08-31 11:43:50 +02:00
Miro Hrončok
e79be2c17a Use SPDX license identifiers, update license
The schematron files are not Zlib licensed, but MIT (since 4.3.0):

5a444c238f
2022-08-31 11:36:03 +02:00
Miro Hrončok
e82cceb573 Drop unfinished sentence from the %description 2022-08-31 11:26:47 +02:00
Miro Hrončok
d8ab550c3c Drop deprecated %python_provide, it is not needed 2022-08-31 11:24:26 +02:00
Miro Hrončok
6659c59618 Expand %{modname} in spec for better readability 2022-08-31 11:23:41 +02:00
Mikolaj Izdebski
f7a9cbe29f Onboard package into gating 2022-08-31 07:07:31 +02:00
Fedora Release Engineering
36529bc549 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-22 19:51:18 +00:00
Charalampos Stratakis
d714fa326e Fix FTBFS with setuptools >= 62.1
Resolves: rhbz#2097102
2022-06-22 20:01:46 +02:00
Python Maint
343c16cba5 Rebuilt for Python 3.11 2022-06-13 16:01:26 +02:00
Fedora Release Engineering
68133020f5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-21 13:17:38 +00:00
Charalampos Stratakis
eb5a8db088 Update to 4.7.1
Fixes CVE-2021-43818

Resolves: rhbz#2031686, rhbz#2032572
2022-01-06 15:10:44 +01:00
Miro Hrončok
27eebecb4d Backport a fix for Python 3.11 2021-11-26 17:18:46 +01:00
Miro Hrončok
b51ac78331 Actually run the tests during build
Fixes https://bugzilla.redhat.com/2026941
2021-11-26 17:18:46 +01:00
Fedora Release Engineering
983dd0d448 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-23 07:20:50 +00:00
Mikolaj Izdebski
1a5f8b2a9f Bump release 2021-06-04 15:05:12 +02:00
Charalampos Stratakis
27ac46f9e9 Update the license information 2021-06-03 20:21:20 +02:00
Python Maint
627098066f Rebuilt for Python 3.10 2021-06-02 15:11:30 +02:00
Charalampos Stratakis
e9743571ee Update to 4.6.3
Fixes CVE-2021-28957
2021-05-20 17:01:27 +02:00
Fedora Release Engineering
eddc9feea5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-27 11:33:58 +00:00
Miro Hrončok
2c9f85992c Update to 4.6.2
The source URL was changed to use PyPI sdist,
because lxml.de does not yet have this version.
2020-12-02 00:24:10 +01:00
11 changed files with 1783 additions and 1844 deletions

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

19
.gitignore vendored
View file

@ -54,3 +54,22 @@ lxml-2.2.7.tar.gz.asc
/lxml-4.4.0.tgz
/lxml-4.4.1.tgz
/lxml-4.5.1.tgz
/lxml-4.6.2.tar.gz
/lxml-4.6.3.tar.gz
/lxml-4.7.1.tar.gz
/lxml-4.9.1.tar.gz
/lxml-4.9.2.tar.gz
/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
/lxml-5.1.0-no-isoschematron-rng.tar.gz
/lxml-5.2.0-no-isoschematron-rng.tar.gz
/lxml-5.2.1-no-isoschematron-rng.tar.gz
/lxml-5.3.0-no-isoschematron-rng.tar.gz
/lxml-5.3.1-no-isoschematron-rng.tar.gz
/lxml-5.3.2-no-isoschematron-rng.tar.gz
/lxml-5.4.0-no-isoschematron-rng.tar.gz
/lxml-6.0.0-no-isoschematron-rng.tar.gz
/lxml-6.0.1-no-isoschematron-rng.tar.gz
/lxml-6.0.2-no-isoschematron-rng.tar.gz

View file

@ -1,277 +0,0 @@
From fa1d856cad369d0ac64323ddec14b02281491706 Mon Sep 17 00:00:00 2001
From: Stefan Behnel <stefan_ml@behnel.de>
Date: Sat, 23 May 2020 09:34:22 +0200
Subject: [PATCH] Avoid globally overriding the libxml2 external entity
resolver and instead set it for each parser run. This improves the
interoperability with other users of libxml2 in the system, such as
libxmlsec.
---
CHANGES.txt | 11 +++++++++++
src/lxml/dtd.pxi | 6 ++++++
src/lxml/parser.pxi | 42 ++++++++++++++++++++++++++++++-----------
src/lxml/relaxng.pxi | 2 ++
src/lxml/schematron.pxi | 4 ++++
src/lxml/xinclude.pxi | 2 ++
src/lxml/xmlschema.pxi | 2 ++
src/lxml/xslt.pxi | 4 ++++
8 files changed, 62 insertions(+), 11 deletions(-)
diff --git a/CHANGES.txt b/CHANGES.txt
index 30e805997..07afb641b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -2,6 +2,17 @@
lxml changelog
==============
+4.5.2 (2020-0?-??)
+==================
+
+Bugs fixed
+----------
+
+* LP#1880251: Instead of globally overwriting the document loader in libxml2, lxml now
+ sets it per parser run, which improves the interoperability with other users of libxml2
+ such as libxmlsec.
+
+
4.5.1 (2020-05-19)
==================
diff --git a/src/lxml/dtd.pxi b/src/lxml/dtd.pxi
index 595296546..5dcb80c46 100644
--- a/src/lxml/dtd.pxi
+++ b/src/lxml/dtd.pxi
@@ -277,14 +277,20 @@ cdef class DTD(_Validator):
if _isString(file):
file = _encodeFilename(file)
with self._error_log:
+ orig_loader = _register_document_loader()
self._c_dtd = xmlparser.xmlParseDTD(NULL, _xcstr(file))
+ _reset_document_loader(orig_loader)
elif hasattr(file, 'read'):
+ orig_loader = _register_document_loader()
self._c_dtd = _parseDtdFromFilelike(file)
+ _reset_document_loader(orig_loader)
else:
raise DTDParseError, u"file must be a filename or file-like object"
elif external_id is not None:
with self._error_log:
+ orig_loader = _register_document_loader()
self._c_dtd = xmlparser.xmlParseDTD(<const_xmlChar*>external_id, NULL)
+ _reset_document_loader(orig_loader)
else:
raise DTDParseError, u"either filename or external ID required"
diff --git a/src/lxml/parser.pxi b/src/lxml/parser.pxi
index 22620373c..3ed223bd5 100644
--- a/src/lxml/parser.pxi
+++ b/src/lxml/parser.pxi
@@ -502,7 +502,15 @@ cdef xmlparser.xmlParserInput* _local_resolver(const_char* c_url, const_char* c_
cdef xmlparser.xmlExternalEntityLoader __DEFAULT_ENTITY_LOADER
__DEFAULT_ENTITY_LOADER = xmlparser.xmlGetExternalEntityLoader()
-xmlparser.xmlSetExternalEntityLoader(<xmlparser.xmlExternalEntityLoader>_local_resolver)
+
+cdef xmlparser.xmlExternalEntityLoader _register_document_loader() nogil:
+ cdef xmlparser.xmlExternalEntityLoader old = xmlparser.xmlGetExternalEntityLoader()
+ xmlparser.xmlSetExternalEntityLoader(<xmlparser.xmlExternalEntityLoader>_local_resolver)
+ return old
+
+cdef void _reset_document_loader(xmlparser.xmlExternalEntityLoader old) nogil:
+ xmlparser.xmlSetExternalEntityLoader(old)
+
############################################################
## Parsers
@@ -514,6 +522,7 @@ cdef class _ParserContext(_ResolverContext):
cdef _ErrorLog _error_log
cdef _ParserSchemaValidationContext _validator
cdef xmlparser.xmlParserCtxt* _c_ctxt
+ cdef xmlparser.xmlExternalEntityLoader _orig_loader
cdef python.PyThread_type_lock _lock
cdef _Document _doc
cdef bint _collect_ids
@@ -561,7 +570,7 @@ cdef class _ParserContext(_ResolverContext):
else:
xmlparser.xmlClearParserCtxt(self._c_ctxt)
- cdef int prepare(self) except -1:
+ cdef int prepare(self, bint set_document_loader=True) except -1:
cdef int result
if config.ENABLE_THREADING and self._lock is not NULL:
with nogil:
@@ -572,19 +581,24 @@ cdef class _ParserContext(_ResolverContext):
self._error_log.clear()
self._doc = None
self._c_ctxt.sax.serror = _receiveParserError
+ self._orig_loader = _register_document_loader() if set_document_loader else NULL
if self._validator is not None:
self._validator.connect(self._c_ctxt, self._error_log)
return 0
cdef int cleanup(self) except -1:
- if self._validator is not None:
- self._validator.disconnect()
- self._resetParserContext()
- self.clear()
- self._doc = None
- self._c_ctxt.sax.serror = NULL
- if config.ENABLE_THREADING and self._lock is not NULL:
- python.PyThread_release_lock(self._lock)
+ if self._orig_loader is not NULL:
+ _reset_document_loader(self._orig_loader)
+ try:
+ if self._validator is not None:
+ self._validator.disconnect()
+ self._resetParserContext()
+ self.clear()
+ self._doc = None
+ self._c_ctxt.sax.serror = NULL
+ finally:
+ if config.ENABLE_THREADING and self._lock is not NULL:
+ python.PyThread_release_lock(self._lock)
return 0
cdef object _handleParseResult(self, _BaseParser parser,
@@ -1286,7 +1300,7 @@ cdef class _FeedParser(_BaseParser):
pctxt = context._c_ctxt
error = 0
if not self._feed_parser_running:
- context.prepare()
+ context.prepare(set_document_loader=False)
self._feed_parser_running = 1
c_filename = (_cstr(self._filename)
if self._filename is not None else NULL)
@@ -1296,6 +1310,7 @@ cdef class _FeedParser(_BaseParser):
# however if we give it all we got, we'll have nothing for
# *mlParseChunk() and things go wrong.
buffer_len = 4 if py_buffer_len > 4 else <int>py_buffer_len
+ orig_loader = _register_document_loader()
if self._for_html:
error = _htmlCtxtResetPush(
pctxt, c_data, buffer_len, c_filename, c_encoding,
@@ -1304,6 +1319,7 @@ cdef class _FeedParser(_BaseParser):
xmlparser.xmlCtxtUseOptions(pctxt, self._parse_options)
error = xmlparser.xmlCtxtResetPush(
pctxt, c_data, buffer_len, c_filename, c_encoding)
+ _reset_document_loader(orig_loader)
py_buffer_len -= buffer_len
c_data += buffer_len
if error:
@@ -1321,7 +1337,9 @@ cdef class _FeedParser(_BaseParser):
buffer_len = <int>py_buffer_len
if self._for_html:
c_node = pctxt.node # last node where the parser stopped
+ orig_loader = _register_document_loader()
error = htmlparser.htmlParseChunk(pctxt, c_data, buffer_len, 0)
+ _reset_document_loader(orig_loader)
# and now for the fun part: move node names to the dict
if pctxt.myDoc:
fixup_error = _fixHtmlDictSubtreeNames(
@@ -1331,7 +1349,9 @@ cdef class _FeedParser(_BaseParser):
pctxt.myDoc.dict = pctxt.dict
xmlparser.xmlDictReference(pctxt.dict)
else:
+ orig_loader = _register_document_loader()
error = xmlparser.xmlParseChunk(pctxt, c_data, buffer_len, 0)
+ _reset_document_loader(orig_loader)
py_buffer_len -= buffer_len
c_data += buffer_len
diff --git a/src/lxml/relaxng.pxi b/src/lxml/relaxng.pxi
index d161ce46e..6a82a295f 100644
--- a/src/lxml/relaxng.pxi
+++ b/src/lxml/relaxng.pxi
@@ -64,7 +64,9 @@ cdef class RelaxNG(_Validator):
doc = None
filename = _encodeFilename(file)
with self._error_log:
+ orig_loader = _register_document_loader()
parser_ctxt = relaxng.xmlRelaxNGNewParserCtxt(_cstr(filename))
+ _reset_document_loader(orig_loader)
elif (_getFilenameForFile(file) or '')[-4:].lower() == '.rnc':
_require_rnc2rng()
rng_data_utf8 = _utf8(_rnc2rng.dumps(_rnc2rng.load(file)))
diff --git a/src/lxml/schematron.pxi b/src/lxml/schematron.pxi
index af4ba7f01..dfd2cc05f 100644
--- a/src/lxml/schematron.pxi
+++ b/src/lxml/schematron.pxi
@@ -95,7 +95,9 @@ cdef class Schematron(_Validator):
filename = file
filename = _encodeFilename(filename)
with self._error_log:
+ orig_loader = _register_document_loader()
parser_ctxt = schematron.xmlSchematronNewParserCtxt(_cstr(filename))
+ _reset_document_loader(orig_loader)
else:
raise SchematronParseError, u"No tree or file given"
@@ -107,7 +109,9 @@ cdef class Schematron(_Validator):
try:
with self._error_log:
+ orig_loader = _register_document_loader()
self._c_schema = schematron.xmlSchematronParse(parser_ctxt)
+ _reset_document_loader(orig_loader)
finally:
schematron.xmlSchematronFreeParserCtxt(parser_ctxt)
diff --git a/src/lxml/xinclude.pxi b/src/lxml/xinclude.pxi
index f73afee61..6bac82923 100644
--- a/src/lxml/xinclude.pxi
+++ b/src/lxml/xinclude.pxi
@@ -49,11 +49,13 @@ cdef class XInclude:
if tree.LIBXML_VERSION < 20704 or not c_context:
__GLOBAL_PARSER_CONTEXT.pushImpliedContext(context)
with nogil:
+ orig_loader = _register_document_loader()
if c_context:
result = xinclude.xmlXIncludeProcessTreeFlagsData(
node._c_node, parse_options, c_context)
else:
result = xinclude.xmlXIncludeProcessTree(node._c_node)
+ _reset_document_loader(orig_loader)
if tree.LIBXML_VERSION < 20704 or not c_context:
__GLOBAL_PARSER_CONTEXT.popImpliedContext()
self._error_log.disconnect()
diff --git a/src/lxml/xmlschema.pxi b/src/lxml/xmlschema.pxi
index cc2c1928d..ab26d935e 100644
--- a/src/lxml/xmlschema.pxi
+++ b/src/lxml/xmlschema.pxi
@@ -77,7 +77,9 @@ cdef class XMLSchema(_Validator):
# resolve requests to the document's parser
__GLOBAL_PARSER_CONTEXT.pushImpliedContextFromParser(self._doc._parser)
with nogil:
+ orig_loader = _register_document_loader()
self._c_schema = xmlschema.xmlSchemaParse(parser_ctxt)
+ _reset_document_loader(orig_loader)
if self._doc is not None:
__GLOBAL_PARSER_CONTEXT.popImpliedContext()
xmlschema.xmlSchemaFreeParserCtxt(parser_ctxt)
diff --git a/src/lxml/xslt.pxi b/src/lxml/xslt.pxi
index e7b49600c..d483cfa30 100644
--- a/src/lxml/xslt.pxi
+++ b/src/lxml/xslt.pxi
@@ -397,7 +397,9 @@ cdef class XSLT:
c_doc._private = <python.PyObject*>self._xslt_resolver_context
with self._error_log:
+ orig_loader = _register_document_loader()
c_style = xslt.xsltParseStylesheetDoc(c_doc)
+ _reset_document_loader(orig_loader)
if c_style is NULL or c_style.errors:
tree.xmlFreeDoc(c_doc)
@@ -633,8 +635,10 @@ cdef class XSLT:
if self._access_control is not None:
self._access_control._register_in_context(transform_ctxt)
with self._error_log, nogil:
+ orig_loader = _register_document_loader()
c_result = xslt.xsltApplyStylesheetUser(
self._c_style, c_input_doc, params, NULL, NULL, transform_ctxt)
+ _reset_document_loader(orig_loader)
return c_result

1642
changelog Normal file

File diff suppressed because it is too large Load diff

1
ci.fmf Normal file
View file

@ -0,0 +1 @@
resultsdb-testcase: separate

8
gating.yaml Normal file
View file

@ -0,0 +1,8 @@
--- !Policy
product_versions:
- fedora-*
decision_contexts:
- bodhi_update_push_testing
- bodhi_update_push_stable
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/smoke.functional}

28
get-lxml-source.sh Executable file
View file

@ -0,0 +1,28 @@
#! /bin/bash -ex
# Download a release of lxml (if missing) and remove the isoschematron module from it
version=$1
if [ -z "${version}" ]; then
echo "Usage: $0 VERSION" >& 2
echo "" >& 2
echo "example: $0 4.9.2" >& 2
exit 1
fi
versionedname=lxml-${version}
orig_archive=${versionedname}.tar.gz
new_archive=${versionedname}-no-isoschematron-rng.tar.gz
if [ ! -e ${orig_archive} ]; then
wget -N https://files.pythonhosted.org/packages/source/l/lxml/${orig_archive}
fi
deleted_directory=lxml-${version}/src/lxml/isoschematron/resources/rng
# tar --delete does not operate on compressed archives, so do
# gz decompression explicitly
gzip --decompress ${orig_archive}
tar -v --delete -f ${orig_archive//.gz} ${deleted_directory}
gzip -cf ${orig_archive//.gz} > ${new_archive}

View file

@ -0,0 +1,7 @@
import lxml.etree as et
s = '<foo><bar baz="xyzzy">a<![CDATA[b]]>c</bar></foo>'
x = et.fromstring(s)
t = x.find('bar').text
print(t)
if t != 'abc':
raise Exception()

12
plans/smoke.fmf Normal file
View file

@ -0,0 +1,12 @@
summary: Basic smoke test
discover:
how: shell
tests:
- name: /smoke/import-python-module
test: |
python3 -c 'import importlib as il; print(il.import_module("lxml"))'
- name: /smoke/etree-fromstring
test: |
python3 plans/etree-fromstring.py
execute:
how: tmt

File diff suppressed because it is too large Load diff

View file

@ -1 +1 @@
SHA512 (lxml-4.5.1.tgz) = 5332d2b691b3d0def42b907a013fa814054dcd150ab6d7adf34891b70667b3e907f80c956a58671d7a31c63caa6110b2e007d2ed82b5fc706e6ad7b428742883
SHA512 (lxml-6.0.2-no-isoschematron-rng.tar.gz) = dc89f75c3a3c828a46bcb2eefbebe8f98ce8072b9fb66f8ef81edbf2babed74e4c54e26392603319d60ab3bfab6a4795eedc85b28efba815797d43d53aae4060