Skip to contentSkip to conversation

python3-yarl: backport fix for test_url_query test

PATCH New Trevor Gamblin 1 participant 1 message Jun 3, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python3-yarl: backport fix for test_url_query test

python3-yarl 1.6.3 still tests semicolons as URL separators, but this test has been removed in master to avoid failures due to upstream Python no longer supporting them by default. See:

https://bugs.python.org/issue42967
https://github.com/aio-libs/yarl/issues/563

---
 ...p-tests-for-semicolon-as-a-separator.patch | 45 +++++++++++++++++++
 .../python/python3-yarl_1.6.3.bb              |  1 +
 2 files changed, 46 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-yarl/0001-Drop-tests-for-semicolon-as-a-separator.patch
meta-python/recipes-devtools/python/python3-yarl/0001-Drop-tests-for-semicolon-as-a-separator.patch new file +45 -0
new file mode 100644
index 000000000..1a9d5d02d
@@ -0,0 +1,45 @@
+From 47eabc562a8883d757e3cff487c6c6e98def5a21 Mon Sep 17 00:00:00 2001
+From: Andrew Svetlov <[email protected]>
+Date: Fri, 28 May 2021 12:42:17 +0300
+Subject: [PATCH] Drop tests for semicolon as a separator
+
+yarl 1.6.3 ptests check the use of semicolons as separators in URLs,
+which are no longer valid by default in newer versions of Python. This
+patch is in python3-yarl master, but there is no release with it yet, so
+backport it until there is a new release.
+
+For more info, see: 
+https://bugs.python.org/issue42967
+https://github.com/aio-libs/yarl/issues/563
+
+Upstream-Status: Backport
+(https://github.com/aio-libs/yarl/commit/47eabc562a8883d757e3cff487c6c6e98def5a21)
+
+Signed-off-by: Trevor Gamblin <[email protected]>
+
+---
+ tests/test_url_query.py | 11 -----------
+ 1 file changed, 11 deletions(-)
+
+diff --git a/tests/test_url_query.py b/tests/test_url_query.py
+index d2ca640..07f858b 100644
+--- a/tests/test_url_query.py
++++ b/tests/test_url_query.py
+@@ -60,14 +60,3 @@ def test_ampersand_as_value():
+     u = URL("http://127.0.0.1/?a=1%26b=2")
+     assert len(u.query) == 1
+     assert u.query["a"] == "1&b=2"
+-
+-
+-def test_semicolon_as_separator():
+-    u = URL("http://127.0.0.1/?a=1;b=2")
+-    assert len(u.query) == 2
+-
+-
+-def test_semicolon_as_value():
+-    u = URL("http://127.0.0.1/?a=1%3Bb=2")
+-    assert len(u.query) == 1
+-    assert u.query["a"] == "1;b=2"
+-- 
+2.31.1
+
meta-python/recipes-devtools/python/python3-yarl_1.6.3.bb +1 -0
index 01682a46d..e0e262646 100644
@@ -7,6 +7,7 @@ SRC_URI[sha256sum] = "8a9066529240171b68893d60dca86a763eae2139dd42f42106b03cf4b4
 
 SRC_URI += " \
     file://run-ptest \
+    file://0001-Drop-tests-for-semicolon-as-a-separator.patch \
 "
 
 PYPI_PACKAGE = "yarl"
Signature · 1 line
2.31.1