From 42248a018d6fe1e39f2739181ef2c8851568f0a7150d22a210fcd00d14706942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sun, 17 Nov 2019 19:39:02 +0000 Subject: [PATCH] Accepting request 749125 from home:dimstar:Factory - Add lxml-libxml-2.9.10.patch: Fix build against libxml 2.9.10. Fixes build in Staging:G OBS-URL: https://build.opensuse.org/request/show/749125 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lxml?expand=0&rev=131 --- lxml-libxml-2.9.10.patch | 48 ++++++++++++++++++++++++++++++++++++++++ python-lxml.changes | 5 +++++ python-lxml.spec | 5 ++++- 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 lxml-libxml-2.9.10.patch diff --git a/lxml-libxml-2.9.10.patch b/lxml-libxml-2.9.10.patch new file mode 100644 index 0000000..65e39e5 --- /dev/null +++ b/lxml-libxml-2.9.10.patch @@ -0,0 +1,48 @@ +From a2551ed1cb862b2113dc13ca6d057208fe02c31e Mon Sep 17 00:00:00 2001 +From: Stefan Behnel +Date: Fri, 1 Nov 2019 08:47:16 +0100 +Subject: [PATCH] Adapt doctest to libxml2 2.9.10. + +--- + doc/api.txt | 19 +++++-------------- + 1 file changed, 5 insertions(+), 14 deletions(-) + +diff --git a/doc/api.txt b/doc/api.txt +index 9e86d182d..ed8db6ddb 100644 +--- a/doc/api.txt ++++ b/doc/api.txt +@@ -323,9 +323,8 @@ error level: + .. sourcecode:: pycon + + >>> log = e.error_log.filter_from_level(etree.ErrorLevels.FATAL) +- >>> print(log) ++ >>> print(log[0]) + :4:8:FATAL:PARSER:ERR_TAG_NAME_MISMATCH: Opening and ending tag mismatch: a line 3 and root +- :5:1:FATAL:PARSER:ERR_TAG_NOT_FINISHED: Premature end of data in tag root line 2 + + This might look a little cryptic at first, but it is the information that + libxml2 gives you. At least the message at the end should give you a hint +@@ -345,18 +344,10 @@ like this: + >>> print(entry.filename) + + +-There is also a convenience attribute ``last_error`` that returns the last +-error or fatal error that occurred: +- +-.. sourcecode:: pycon +- +- >>> entry = e.error_log.last_error +- >>> print(entry.domain_name) +- PARSER +- >>> print(entry.type_name) +- ERR_TAG_NOT_FINISHED +- >>> print(entry.filename) +- ++There is also a convenience attribute ``error_log.last_error`` that returns the ++last error or fatal error that occurred, so that it's easy to test if there was ++an error at all. Note, however, that there might have been more than one error, ++and the first error that occurred might be more relevant in some cases. + + + Error logging + diff --git a/python-lxml.changes b/python-lxml.changes index 26b95b9..218f7b0 100644 --- a/python-lxml.changes +++ b/python-lxml.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Nov 17 14:25:04 UTC 2019 - Dominique Leuenberger + +- Add lxml-libxml-2.9.10.patch: Fix build against libxml 2.9.10. + ------------------------------------------------------------------- Wed Sep 11 12:48:12 UTC 2019 - Tomáš Chvátal diff --git a/python-lxml.spec b/python-lxml.spec index 7bef0b6..1cc5194 100644 --- a/python-lxml.spec +++ b/python-lxml.spec @@ -1,7 +1,7 @@ # # spec file for package python-lxml # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,6 +26,8 @@ Group: Development/Languages/Python URL: https://lxml.de/ Source0: https://files.pythonhosted.org/packages/source/l/lxml/lxml-%{version}.tar.gz Source1: https://lxml.de/lxmldoc-%{version}.pdf +# PATCH-FIX-UPSTREAM lxml-libxml-2.9.10.patch dimstar@opensuse.org -- Fix build against libxml 2.9.10 +Patch0: lxml-libxml-2.9.10.patch BuildRequires: %{python_module Cython >= 0.29.7} BuildRequires: %{python_module cssselect >= 0.9.1} BuildRequires: %{python_module setuptools >= 18.0.1} @@ -71,6 +73,7 @@ This package contains header files needed to use lxml's C API. %prep %setup -q -n lxml-%{version} +%patch0 -p1 cp %{SOURCE1} . # remove generated files