[packages/python-bs4] - added smart_quotes patch (give some encoding hint in test, it failed on python3)

qboosh qboosh at pld-linux.org
Mon Mar 21 19:06:16 CET 2022


commit a307bef6fce9b77e428d97bb5965ba5d676334dc
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Mon Mar 21 19:08:09 2022 +0100

    - added smart_quotes patch (give some encoding hint in test, it failed on python3)

 python-bs4-smart_quotes.patch | 11 +++++++++++
 python-bs4.spec               |  2 ++
 2 files changed, 13 insertions(+)
---
diff --git a/python-bs4.spec b/python-bs4.spec
index 2015685..f0d014b 100644
--- a/python-bs4.spec
+++ b/python-bs4.spec
@@ -18,6 +18,7 @@ Source0:	https://files.pythonhosted.org/packages/source/b/beautifulsoup4/beautif
 # Source0-md5:	c17714d0f91a23b708a592cb3c697728
 Patch0:		test_suite.patch
 Patch1:		%{name}-lxml.patch
+Patch2:		%{name}-smart_quotes.patch
 URL:		https://www.crummy.com/software/BeautifulSoup/
 BuildRequires:	rpmbuild(macros) >= 1.714
 BuildRequires:	rpm-pythonprov
@@ -75,6 +76,7 @@ Dokumentacja API modułu Pythona beautifulsoup4.
 %setup -q -n beautifulsoup4-%{version}
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 %if %{with python2}
diff --git a/python-bs4-smart_quotes.patch b/python-bs4-smart_quotes.patch
new file mode 100644
index 0000000..e1399f5
--- /dev/null
+++ b/python-bs4-smart_quotes.patch
@@ -0,0 +1,11 @@
+--- beautifulsoup4-4.6.3/bs4/tests/test_soup.py.orig	2016-07-27 03:27:42.000000000 +0200
++++ beautifulsoup4-4.6.3/bs4/tests/test_soup.py	2022-03-21 18:20:50.490829014 +0100
+@@ -171,7 +171,7 @@ class TestEntitySubstitution(unittest.Te
+         # MS smart quotes are a common source of frustration, so we
+         # give them a special test.
+         quotes = b"\x91\x92foo\x93\x94"
+-        dammit = UnicodeDammit(quotes)
++        dammit = UnicodeDammit(quotes, override_encodings=["windows-1252"])
+         self.assertEqual(self.sub.substitute_html(dammit.markup),
+                           "‘’foo“”")
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-bs4.git/commitdiff/a307bef6fce9b77e428d97bb5965ba5d676334dc



More information about the pld-cvs-commit mailing list