summaryrefslogtreecommitdiffstats
path: root/meta-python
diff options
context:
space:
mode:
Diffstat (limited to 'meta-python')
-rw-r--r--meta-python/recipes-devtools/python/python3-requests-toolbelt/0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch41
-rw-r--r--meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb5
2 files changed, 44 insertions, 2 deletions
diff --git a/meta-python/recipes-devtools/python/python3-requests-toolbelt/0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch b/meta-python/recipes-devtools/python/python3-requests-toolbelt/0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch
new file mode 100644
index 0000000000..baa833b6d2
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-requests-toolbelt/0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch
@@ -0,0 +1,41 @@
1From 7188b06330e5260be20bce8cbcf0d5ae44e34eaf Mon Sep 17 00:00:00 2001
2From: Jon Dufresne <jon.dufresne@gmail.com>
3Date: Fri, 1 Feb 2019 16:30:01 -0800
4Subject: [PATCH] Fix collections.abc deprecation warning in downloadutils
5
6Warning appears as:
7
8tests/test_downloadutils.py::test_stream_response_to_specific_filename
9 requests_toolbelt/downloadutils/stream.py:161: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
10 if path and isinstance(getattr(path, 'write', None), collections.Callable):
11
12Upstream-Status: Backport [https://github.com/requests/toolbelt/commit/7188b06330e5260be20bce8cbcf0d5ae44e34eaf]
13
14Signed-off-by: Narpat Mali <narpat.mali@windriver.com>
15---
16 requests_toolbelt/downloadutils/stream.py | 3 +--
17 1 file changed, 1 insertion(+), 2 deletions(-)
18
19diff --git a/requests_toolbelt/downloadutils/stream.py b/requests_toolbelt/downloadutils/stream.py
20index eed60a7..1d1c31b 100644
21--- a/requests_toolbelt/downloadutils/stream.py
22+++ b/requests_toolbelt/downloadutils/stream.py
23@@ -1,6 +1,5 @@
24 # -*- coding: utf-8 -*-
25 """Utilities for dealing with streamed requests."""
26-import collections
27 import os.path
28 import re
29
30@@ -158,7 +157,7 @@ def stream_response_to_file(response, path=None, chunksize=_DEFAULT_CHUNKSIZE):
31 pre_opened = False
32 fd = None
33 filename = None
34- if path and isinstance(getattr(path, 'write', None), collections.Callable):
35+ if path and callable(getattr(path, 'write', None)):
36 pre_opened = True
37 fd = path
38 filename = getattr(fd, 'name', None)
39--
402.25.1
41
diff --git a/meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb b/meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb
index 366f41ca81..72ad7a6180 100644
--- a/meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb
+++ b/meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb
@@ -6,7 +6,8 @@ LICENSE = "Apache-2.0"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=71760e0f1dda8cff91b0bc9246caf571" 6LIC_FILES_CHKSUM = "file://LICENSE;md5=71760e0f1dda8cff91b0bc9246caf571"
7 7
8SRC_URI = "file://run-ptest \ 8SRC_URI = "file://run-ptest \
9 " 9 file://0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch \
10 "
10 11
11SRC_URI[md5sum] = "b1509735c4b4cf95df2619facbc3672e" 12SRC_URI[md5sum] = "b1509735c4b4cf95df2619facbc3672e"
12SRC_URI[sha256sum] = "968089d4584ad4ad7c171454f0a5c6dac23971e9472521ea3b6d49d610aa6fc0" 13SRC_URI[sha256sum] = "968089d4584ad4ad7c171454f0a5c6dac23971e9472521ea3b6d49d610aa6fc0"
@@ -31,4 +32,4 @@ do_install_ptest() {
31 # remove test test_multipart_encoder.py as it fails, 32 # remove test test_multipart_encoder.py as it fails,
32 # downloaded file is not supported 33 # downloaded file is not supported
33 rm -f ${D}${PTEST_PATH}/tests/test_multipart_encoder.py 34 rm -f ${D}${PTEST_PATH}/tests/test_multipart_encoder.py
34} 35}