CentOS 8: Upgrade python-requests to version 2.20.0

(1)Release Version Upgrade
(2)Matching code changes with el7 to el8

This package actually comes from the openstack package repo [0]
and the correct version is 2.21.0-3.
Since the CentOS folks have not created a cloud repo yet.
Ultimately this will need to be a python3 version.
We will need to rename the package to python3-requests.

[0] http://vault.centos.org/7.7.1908/cloud/Source/openstack-stein/

Story: 2006729
Task: 37659
Depends-On: https://review.opendev.org/#/c/696481/
Depends-On: https://review.opendev.org/#/c/696050/
Change-Id: I8544995320fa440074554c6fdf0e1143bf68b582
Signed-off-by: Dongqi Chen <chen.dq@neusoft.com>
This commit is contained in:
chendongqi 2019-11-20 18:20:29 +08:00
parent 9035cd1be8
commit be8e0dfa61
5 changed files with 17 additions and 13 deletions

View File

@ -1 +1 @@
TIS_PATCH_VER=2
TIS_PATCH_VER=1

View File

@ -3,6 +3,7 @@ From: jmckenna <jason.mckenna@windriver.com>
Date: Wed, 13 Dec 2017 09:02:08 -0500
Subject: [PATCH 1/2] Update package versioning for TIS format
Signed-off-by: Dongqi Chen <chen.dq@neusoft.com>
---
SPECS/python-requests.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@ -11,12 +12,12 @@ diff --git a/SPECS/python-requests.spec b/SPECS/python-requests.spec
index efe0966..111bab7 100644
--- a/SPECS/python-requests.spec
+++ b/SPECS/python-requests.spec
@@ -13,7 +13,7 @@
@@ -10,7 +10,7 @@
Name: python-requests
Version: 2.21.0
-Release: 2%{?dist}
+Release: 2.el7%{?_tis_dist}.%{tis_patch_ver}
Version: 2.20.0
-Release: 1%{?dist}
+Release: 1.el8%{?_tis_dist}.%{tis_patch_ver}
Summary: HTTP library, written in Python, for human beings
License: ASL 2.0

View File

@ -3,6 +3,7 @@ From: jmckenna <jason.mckenna@windriver.com>
Date: Wed, 13 Dec 2017 09:02:40 -0500
Subject: [PATCH 2/2] include patch for error handling
Signed-off-by: Dongqi Chen <chen.dq@neusoft.com>
---
SPECS/python-requests.spec | 2 ++
1 file changed, 2 insertions(+)
@ -11,10 +12,10 @@ diff --git a/SPECS/python-requests.spec b/SPECS/python-requests.spec
index 111bab7..8aab964 100644
--- a/SPECS/python-requests.spec
+++ b/SPECS/python-requests.spec
@@ -39,6 +39,8 @@ Patch2: python-requests-urllib3-at-%{urllib3_unbundled_version}.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1653223
Patch5: requests-2.20.0-no-py2-httpbin.patch
@@ -38,6 +38,8 @@ Patch4: Don-t-inject-pyopenssl-into-urllib3.patch
# build-time package tests
Patch5: Skip-all-tests-needing-httpbin.patch
+Patch6: 0001-close-connection-on-HTTP-413-Request-Entit.patch
+
BuildArch: noarch

View File

@ -7,6 +7,8 @@ Subject: [PATCH] close connection on HTTP 413 Request Entity Too
Allow low_conn to retrieve/handle unread response data buffers
in case ProtocolError or socket.error are raised while sending
request data.
Signed-off-by: Dongqi Chen <chen.dq@neusoft.com>
---
requests/adapters.py | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
@ -16,9 +18,9 @@ index fd46325..087258a 100644
--- a/requests/adapters.py
+++ b/requests/adapters.py
@@ -466,12 +466,18 @@ class HTTPAdapter(BaseAdapter):
low_conn.endheaders()
- for i in request.body:
- low_conn.send(hex(len(i))[2:].encode('utf-8'))
- low_conn.send(b'\r\n')
@ -37,7 +39,7 @@ index fd46325..087258a 100644
+ # data buffers in case ProtocolError or socket.error
+ # are raised while sending request data
+ pass
# Receive the response from the server
try:
--

View File

@ -1 +1 @@
mirror:Source/python-requests-2.21.0-2.el7.src.rpm
mirror:Source/python-requests-2.20.0-1.el8.src.rpm