!63 Upgrade to latest release [python-lxml -> 4.9.2]
From: @Wangjunqi123 Reviewed-by: @gaoruoshu Signed-off-by: @gaoruoshu
This commit is contained in:
commit
20192d3c9b
@ -1,56 +0,0 @@
|
||||
From c742576c105f40fc8b754fcae56fee4aa35840a3 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Behnel <stefan_ml@behnel.de>
|
||||
Date: Tue, 19 Jul 2022 08:25:20 +0200
|
||||
Subject: [PATCH] Work around libxml2 bug in affected versions that failed to
|
||||
reset the namespace count in the parser context.
|
||||
|
||||
See https://gitlab.gnome.org/GNOME/libxml2/-/issues/378
|
||||
---
|
||||
src/lxml/includes/xmlparser.pxd | 1 +
|
||||
src/lxml/parser.pxi | 3 +++
|
||||
src/lxml/tests/test_etree.py | 3 +--
|
||||
3 files changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/lxml/includes/xmlparser.pxd b/src/lxml/includes/xmlparser.pxd
|
||||
index a196e34..45acfc8 100644
|
||||
--- a/src/lxml/includes/xmlparser.pxd
|
||||
+++ b/src/lxml/includes/xmlparser.pxd
|
||||
@@ -144,6 +144,7 @@ cdef extern from "libxml/parser.h":
|
||||
void* userData
|
||||
int* spaceTab
|
||||
int spaceMax
|
||||
+ int nsNr
|
||||
bint html
|
||||
bint progressive
|
||||
int inSubset
|
||||
diff --git a/src/lxml/parser.pxi b/src/lxml/parser.pxi
|
||||
index f5baf29..f0c8c6b 100644
|
||||
--- a/src/lxml/parser.pxi
|
||||
+++ b/src/lxml/parser.pxi
|
||||
@@ -569,6 +569,9 @@ cdef class _ParserContext(_ResolverContext):
|
||||
self._c_ctxt.disableSAX = 0 # work around bug in libxml2
|
||||
else:
|
||||
xmlparser.xmlClearParserCtxt(self._c_ctxt)
|
||||
+ # work around bug in libxml2 [2.9.10 .. 2.9.14]:
|
||||
+ # https://gitlab.gnome.org/GNOME/libxml2/-/issues/378
|
||||
+ self._c_ctxt.nsNr = 0
|
||||
|
||||
cdef int prepare(self, bint set_document_loader=True) except -1:
|
||||
cdef int result
|
||||
diff --git a/src/lxml/tests/test_etree.py b/src/lxml/tests/test_etree.py
|
||||
index 8bf82c0..0339796 100644
|
||||
--- a/src/lxml/tests/test_etree.py
|
||||
+++ b/src/lxml/tests/test_etree.py
|
||||
@@ -1491,8 +1491,7 @@ class ETreeOnlyTestCase(HelperTestCase):
|
||||
# This would be the expected result, because there was no namespace
|
||||
pass
|
||||
else:
|
||||
- # This is a bug in libxml2
|
||||
- assert not ns, repr(ns)
|
||||
+ assert False, "Found unexpected namespace '%s'" % ns
|
||||
|
||||
def test_itertext_comment_pi(self):
|
||||
# https://bugs.launchpad.net/lxml/+bug/1844674
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
Binary file not shown.
BIN
lxml-4.9.2.tar.gz
Normal file
BIN
lxml-4.9.2.tar.gz
Normal file
Binary file not shown.
@ -1,59 +1,83 @@
|
||||
%global modname lxml
|
||||
%global _empty_manifest_terminate_build 0
|
||||
%global _description \
|
||||
The lxml XML toolkit is a Pythonic binding for the C libraries libxml2 and libxslt. \
|
||||
It is unique in that it combines the speed and XML feature completeness of these libraries with \
|
||||
the simplicity of a native Python API, mostly compatible but superior to the well-known ElementTree API. \
|
||||
The latest release works with all CPython versions from 2.7 to 3.7.
|
||||
|
||||
Name: python-%{modname}
|
||||
Version: 4.9.1
|
||||
Release: 3
|
||||
Name: python-lxml
|
||||
Version: 4.9.2
|
||||
Release: 1
|
||||
Summary: XML processing library combining libxml2/libxslt with the ElementTree API
|
||||
License: BSD
|
||||
URL: https://github.com/lxml/lxml
|
||||
Source0: %_sourcedir/lxml-%{version}.tar.gz
|
||||
Source0: https://files.pythonhosted.org/packages/06/5a/e11cad7b79f2cf3dd2ff8f81fa8ca667e7591d3d8451768589996b65dec1/lxml-4.9.2.tar.gz
|
||||
|
||||
Patch6000: backport-Work-around-libxml2-bug-in-affected-versions.patch
|
||||
%description
|
||||
%{_description}
|
||||
|
||||
BuildRequires: gcc libxml2-devel libxslt-devel
|
||||
%package -n python3-lxml
|
||||
Summary: XML processing library combining libxml2/libxslt with the ElementTree API
|
||||
Provides: python-lxml = %{version}-%{release}
|
||||
BuildRequires: gcc
|
||||
BuildRequires: libxml2-devel
|
||||
BuildRequires: libxslt-devel
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-setuptools
|
||||
BuildRequires: python3-Cython
|
||||
%description -n python3-lxml
|
||||
%{_description}
|
||||
|
||||
%description %{_description}
|
||||
|
||||
|
||||
%package -n python3-%{modname}
|
||||
Summary: %{summary}
|
||||
BuildRequires: python3-devel python3-setuptools python3-Cython
|
||||
%{?python_provide:%python_provide python3-%{modname}}
|
||||
|
||||
%description -n python3-%{modname} %{_description}
|
||||
|
||||
%package_help
|
||||
%package help
|
||||
Summary: Development documents and examples for lxml
|
||||
Provides: python3-lxml-doc
|
||||
%description help
|
||||
%{_description}
|
||||
|
||||
%prep
|
||||
%autosetup -n %{modname}-%{version} -p1
|
||||
# Remove pregenerated Cython C sources
|
||||
%autosetup -n lxml-%{version}
|
||||
find -type f -name '*.c' -print -delete
|
||||
|
||||
%build
|
||||
export WITH_CYTHON=true
|
||||
%py3_build
|
||||
|
||||
%install
|
||||
%py3_install
|
||||
pushd %{buildroot}
|
||||
if [ -d usr/lib ]; then
|
||||
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
|
||||
fi
|
||||
if [ -d usr/lib64 ]; then
|
||||
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
|
||||
fi
|
||||
if [ -d usr/bin ]; then
|
||||
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
|
||||
fi
|
||||
if [ -d usr/sbin ]; then
|
||||
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
|
||||
fi
|
||||
touch doclist.lst
|
||||
if [ -d usr/share/man ]; then
|
||||
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
|
||||
fi
|
||||
popd
|
||||
mv %{buildroot}/filelist.lst .
|
||||
mv %{buildroot}/doclist.lst .
|
||||
|
||||
%check
|
||||
make test3
|
||||
|
||||
|
||||
%files -n python3-%{modname}
|
||||
%files -n python3-lxml -f filelist.lst
|
||||
%license doc/licenses/*.txt LICENSES.txt
|
||||
%{python3_sitearch}/%{modname}/
|
||||
%{python3_sitearch}/*.egg-info/
|
||||
%dir %{python3_sitearch}/*
|
||||
|
||||
%files help
|
||||
%files help -f doclist.lst
|
||||
%doc README.rst src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt
|
||||
|
||||
%changelog
|
||||
* Wed Dec 14 2022 wangjunqi <wangjunqi@kylinos.cn> - 4.9.2-1
|
||||
- Update package to version 4.9.2
|
||||
|
||||
* Fri Jul 29 2022 renhongxun <renhongxun@h-partners.com> - 4.9.1-3
|
||||
- add amended patch for cve-2022-2309
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user