guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#54465] [PATCH] gnu: Added patch to python-w3lib for broken test.


From: Pradana Adrinusa AUMARS
Subject: [bug#54465] [PATCH] gnu: Added patch to python-w3lib for broken test.
Date: Sat, 19 Mar 2022 14:56:21 +0100

>From 8aaddbdd5b5c51043b3ddfa4aefb72361f0f763f Mon Sep 17 00:00:00 2001
From: Pradana AUMARS <paumars@courrier.dev>
Date: Sat, 19 Mar 2022 14:51:22 +0100
Subject: [PATCH] gnu: Added patch to python-w3lib for broken test.

* gnu/packages/python-web.scm (python-w3lib): Added a patch for the broken test.
* gnu/packages/patches/python-w3lib-broken-test.patch: New file.
---
 .../patches/python-w3lib-broken-test.patch    | 31 +++++++++++++++++++
 gnu/packages/python-web.scm                   |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 gnu/packages/patches/python-w3lib-broken-test.patch

diff --git a/gnu/packages/patches/python-w3lib-broken-test.patch 
b/gnu/packages/patches/python-w3lib-broken-test.patch
new file mode 100644
index 0000000000..5b4a628268
--- /dev/null
+++ b/gnu/packages/patches/python-w3lib-broken-test.patch
@@ -0,0 +1,31 @@
+From 78054f19bfe20555792b0f336b423921fe88b994 Mon Sep 17 00:00:00 2001
+From: Anders Kaseorg <andersk@mit.edu>
+Date: Mon, 1 Mar 2021 11:34:23 -0800
+Subject: [PATCH] Remove test broken by Python CVE-2021-23336 fix
+
+In Python 3.6.13, 3.7.10, 3.8.8, and 3.9.2, urllib.parse.parse_qsl no
+longer treats ; as a separator by default
+(https://bugs.python.org/issue42967).
+
+Fixes #164.
+
+Signed-off-by: Anders Kaseorg <andersk@mit.edu>
+---
+ tests/test_url.py | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/tests/test_url.py b/tests/test_url.py
+index 3ff544e..e90065c 100644
+--- a/tests/test_url.py
++++ b/tests/test_url.py
+@@ -299,10 +299,6 @@ def test_add_or_replace_parameter(self):
+         self.assertEqual(add_or_replace_parameter(url, 'arg3', 'nv3'),
+                          'http://domain/test?arg1=v1&arg2=v2&arg3=nv3')
+ 
+-        url = 'http://domain/test?arg1=v1;arg2=v2'
+-        self.assertEqual(add_or_replace_parameter(url, 'arg1', 'v3'),
+-                         'http://domain/test?arg1=v3&arg2=v2')
+-
+         
self.assertEqual(add_or_replace_parameter("http://domain/moreInfo.asp?prodID=";, 
'prodID', '20'),
+                          'http://domain/moreInfo.asp?prodID=20')
+         url = 'http://rmc-offers.co.uk/productlist.asp?BCat=2%2C60&CatID=60'
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 9c2a48166a..8b460075c0 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -6189,6 +6189,7 @@ (define-public python-w3lib
      (origin
        (method url-fetch)
        (uri (pypi-uri "w3lib" version))
+       (patches (search-patches "python-w3lib-broken-test.patch"))
        (sha256
         (base32
          "1pv02lvvmgz2qb61vz1jkjc04fgm4hpfvaj5zm4i3mjp64hd1mha"))))
-- 
2.34.0







reply via email to

[Prev in Thread] Current Thread [Next in Thread]