!74 [sync] PR-73: fix issue https://gitee.com/src-openeuler/python-urllib3/issues/I6W6YX
From: @openeuler-sync-bot Reviewed-by: @zengwefeng Signed-off-by: @zengwefeng
This commit is contained in:
commit
d46afef458
34
backport-fix-NRESERVED_PAT-and-_idna_encode.patch
Normal file
34
backport-fix-NRESERVED_PAT-and-_idna_encode.patch
Normal file
@ -0,0 +1,34 @@
|
||||
From b7c63ba938344c8911b4c3b32faf8d0029f879e6 Mon Sep 17 00:00:00 2001
|
||||
From: xzf1234 <xzff@hust.edu.cn>
|
||||
Date: Sun, 23 Apr 2023 20:25:38 +0800
|
||||
Subject: [PATCH] second
|
||||
|
||||
---
|
||||
urllib3-1.25.9/src/urllib3/util/url.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/urllib3/util/url.py b/src/urllib3/util/url.py
|
||||
index 793324e..2f7fdaa 100644
|
||||
--- a/src/urllib3/util/url.py
|
||||
+++ b/src/urllib3/util/url.py
|
||||
@@ -50,7 +50,7 @@ _variations = [
|
||||
"(?:(?:%(hex)s:){0,6}%(hex)s)?::",
|
||||
]
|
||||
|
||||
-UNRESERVED_PAT = r"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._!\-~"
|
||||
+UNRESERVED_PAT = r"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._\-~"
|
||||
IPV6_PAT = "(?:" + "|".join([x % _subs for x in _variations]) + ")"
|
||||
ZONE_ID_PAT = "(?:%25|%)(?:[" + UNRESERVED_PAT + "]|%[a-fA-F0-9]{2})+"
|
||||
IPV6_ADDRZ_PAT = r"\[" + IPV6_PAT + r"(?:" + ZONE_ID_PAT + r")?\]"
|
||||
@@ -300,7 +300,7 @@ def _normalize_host(host, scheme):
|
||||
|
||||
|
||||
def _idna_encode(name):
|
||||
- if name and any([ord(x) > 128 for x in name]):
|
||||
+ if name and any(ord(x) >= 128 for x in name):
|
||||
try:
|
||||
import idna
|
||||
except ImportError:
|
||||
--
|
||||
2.33.1.windows.1
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
Name: python-%{srcname}
|
||||
Version: 1.25.9
|
||||
Release: 7
|
||||
Release: 8
|
||||
Summary: Sanity-friendly HTTP client for Python
|
||||
License: MIT
|
||||
URL: https://urllib3.readthedocs.io
|
||||
@ -18,6 +18,7 @@ Patch6002: backport-Do-not-insert-None-into-ConnectionPool-if-it-was-empty.
|
||||
Patch6003: backport-add-server_hostname-to-SSL_KEYWORDS.patch
|
||||
Patch6004: backport-strip-leading-zeros-form-ports.patch
|
||||
Patch6005: backport-fixed-issue-with-port-0-returning-None.patch
|
||||
Patch6006: backport-fix-NRESERVED_PAT-and-_idna_encode.patch
|
||||
|
||||
%global _description \
|
||||
HTTP library with thread-safe connection pooling, file post support,\
|
||||
@ -119,6 +120,12 @@ PYTHONPATH=%{buildroot}%{python3_sitelib}:%{python3_sitelib} %{__python3} -m pyt
|
||||
%{python3_sitelib}/urllib3-*.egg-info
|
||||
|
||||
%changelog
|
||||
* Sun Apr 23 2023 xzf1244 <xzff@hust.edu.cn> - 1.25.9-8
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
- SUG:NA
|
||||
- DESC:fix field NRESERVED_PAT and function _idna_encode that will cause bugs
|
||||
|
||||
* Thu Jan 19 2023 chenhaixing <chenhaixing@huawei.com> - 1.25.9-7
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user