Accepting request 645906 from devel:languages:python

- Update to 1.24:
  * Allow key_server_hostname to be specified when initializing a PoolManager to allow custom SNI to be overridden. (Pull #1449)
  * Test against Python 3.7 on AppVeyor. (Pull #1453)
  * Early-out ipv6 checks when running on App Engine. (Pull #1450)
  * Change ambiguous description of backoff_factor (Pull #1436)
  * Add ability to handle multiple Content-Encodings (Issue #1441 and Pull #1442)
  * Skip DNS names that can't be idna-decoded when using pyOpenSSL (Issue #1405).
  * Add a server_hostname parameter to HTTPSConnection which allows for overriding the SNI hostname sent in the handshake. (Pull #1397)
  * Drop support for EOL Python 2.6 (Pull #1429 and Pull #1430)
  * Fixed bug where responses with header Content-Type: message/* erroneously raised HeaderParsingError, resulting in a warning being logged. (Pull #1439)
  * Move urllib3 to src/urllib3 (Pull #1409)
- Drop patch 1414.patch merged upstream
- Refresh patches:
  * python-urllib3-recent-date.patch
  * urllib3-ssl-default-context.patch

OBS-URL: https://build.opensuse.org/request/show/645906
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-urllib3?expand=0&rev=24
This commit is contained in:
Dominique Leuenberger 2018-11-06 14:35:04 +00:00 committed by Git OBS Bridge
commit b5f5150e3f
7 changed files with 31 additions and 100 deletions

View File

@ -1,83 +0,0 @@
From f8c3e96df731eccda202e0dc909f0a51cdc41267 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Sat, 14 Jul 2018 12:21:50 +0200
Subject: [PATCH 1/2] dummyserver: Update for tornado-5 API changes
Tornado 5 has apparently removed support for multiple IOLoops,
and appropriately removed the io_loop parameter to the server class
in favor of using IOLoop.current(). Update the tests to use the latter.
The code remains compatible with tornado-4.
---
dummyserver/server.py | 9 +++++----
dummyserver/testcase.py | 4 ++--
2 files changed, 7 insertions(+), 6 deletions(-)
Index: urllib3-1.23/dummyserver/server.py
===================================================================
--- urllib3-1.23.orig/dummyserver/server.py
+++ urllib3-1.23/dummyserver/server.py
@@ -226,15 +226,16 @@ def bind_sockets(port, address=None, fam
def run_tornado_app(app, io_loop, certs, scheme, host):
+ assert io_loop == tornado.ioloop.IOLoop.current()
+
# We can't use fromtimestamp(0) because of CPython issue 29097, so we'll
# just construct the datetime object directly.
app.last_req = datetime(1970, 1, 1)
if scheme == 'https':
- http_server = tornado.httpserver.HTTPServer(app, ssl_options=certs,
- io_loop=io_loop)
+ http_server = tornado.httpserver.HTTPServer(app, ssl_options=certs)
else:
- http_server = tornado.httpserver.HTTPServer(app, io_loop=io_loop)
+ http_server = tornado.httpserver.HTTPServer(app)
sockets = bind_sockets(None, address=host)
port = sockets[0].getsockname()[1]
@@ -268,7 +269,7 @@ if __name__ == '__main__':
from .testcase import TestingApp
host = '127.0.0.1'
- io_loop = tornado.ioloop.IOLoop()
+ io_loop = tornado.ioloop.IOLoop.current()
app = tornado.web.Application([(r".*", TestingApp)])
server, port = run_tornado_app(app, io_loop, None,
'http', host)
Index: urllib3-1.23/dummyserver/testcase.py
===================================================================
--- urllib3-1.23.orig/dummyserver/testcase.py
+++ urllib3-1.23/dummyserver/testcase.py
@@ -124,7 +124,7 @@ class HTTPDummyServerTestCase(unittest.T
@classmethod
def _start_server(cls):
- cls.io_loop = ioloop.IOLoop()
+ cls.io_loop = ioloop.IOLoop.current()
app = web.Application([(r".*", TestingApp)])
cls.server, cls.port = run_tornado_app(app, cls.io_loop, cls.certs,
cls.scheme, cls.host)
@@ -170,7 +170,7 @@ class HTTPDummyProxyTestCase(unittest.Te
@classmethod
def setUpClass(cls):
- cls.io_loop = ioloop.IOLoop()
+ cls.io_loop = ioloop.IOLoop.current()
app = web.Application([(r'.*', TestingApp)])
cls.http_server, cls.http_port = run_tornado_app(
Index: urllib3-1.23/dev-requirements.txt
===================================================================
--- urllib3-1.23.orig/dev-requirements.txt
+++ urllib3-1.23/dev-requirements.txt
@@ -3,7 +3,8 @@ coverage==3.7.1
tox==2.1.1
twine==1.5.0
wheel==0.24.0
-tornado==4.2.1
+tornado==5.0.2; python_version>"2.6"
+tornado==4.2.1; python_version<="2.6"
PySocks==1.5.6
pkginfo>=1.0,!=1.3.0
psutil==4.3.1

View File

@ -10,13 +10,13 @@ Also clarify the comment about how to update RECENT_DATE
Fixes #1303
---
urllib3/connection.py | 6 +++---
src/urllib3/connection.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Index: urllib3-1.23/urllib3/connection.py
===================================================================
--- urllib3-1.23.orig/urllib3/connection.py
+++ urllib3-1.23/urllib3/connection.py
--- urllib3-1.23.orig/src/urllib3/connection.py
+++ urllib3-1.23/src/urllib3/connection.py
@@ -60,7 +60,7 @@ port_by_scheme = {
# and not less than 6 months ago.
# Example: if Today is 2018-01-01, then RECENT_DATE should be any date on or

View File

@ -1,3 +1,22 @@
-------------------------------------------------------------------
Thu Nov 1 14:14:34 UTC 2018 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 1.24:
* Allow key_server_hostname to be specified when initializing a PoolManager to allow custom SNI to be overridden. (Pull #1449)
* Test against Python 3.7 on AppVeyor. (Pull #1453)
* Early-out ipv6 checks when running on App Engine. (Pull #1450)
* Change ambiguous description of backoff_factor (Pull #1436)
* Add ability to handle multiple Content-Encodings (Issue #1441 and Pull #1442)
* Skip DNS names that can't be idna-decoded when using pyOpenSSL (Issue #1405).
* Add a server_hostname parameter to HTTPSConnection which allows for overriding the SNI hostname sent in the handshake. (Pull #1397)
* Drop support for EOL Python 2.6 (Pull #1429 and Pull #1430)
* Fixed bug where responses with header Content-Type: message/* erroneously raised HeaderParsingError, resulting in a warning being logged. (Pull #1439)
* Move urllib3 to src/urllib3 (Pull #1409)
- Drop patch 1414.patch merged upstream
- Refresh patches:
* python-urllib3-recent-date.patch
* urllib3-ssl-default-context.patch
-------------------------------------------------------------------
Fri Sep 7 14:45:38 CEST 2018 - mcepl@suse.com

View File

@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
@ -31,15 +31,13 @@ Name: python-urllib3-%{flavor}
%else
Name: python-urllib3
%endif
Version: 1.23
Version: 1.24
Release: 0
Summary: HTTP library with thread-safe connection pooling, file post, and more
License: MIT
Group: Development/Languages/Python
URL: http://urllib3.readthedocs.org/
Source: https://files.pythonhosted.org/packages/source/u/urllib3/urllib3-%{version}.tar.gz
# PATCH-FIX-UPSTREAM -- tornado 5.x support for tests
Patch1: 1414.patch
# PATCH-FEATURE-UPSTREAM -- use set_default_verify_paths() if no certificate path is supplied
# should be removed in the future, see SR#437853
Patch2: urllib3-ssl-default-context.patch
@ -92,11 +90,8 @@ Highlights
%prep
%setup -q -n urllib3-%{version}
%patch1 -p1
%patch2 -p1
%if %(python3 -c "import ssl; print(hasattr(ssl,'PROTOCOL_TLSv1_2'))") == "True"
%patch3 -p1
%endif
%patch4 -p1
find . -type f -exec chmod a-x '{}' \;
@ -127,7 +122,7 @@ export TRAVIS=1
--ignore=test/with_dummyserver/test_proxy_poolmanager.py \
--ignore=test/with_dummyserver/test_poolmanager.py \
-k "${skiplist}" \
urllib3 test}
src/urllib3 test}
rm -rf %{buildroot}%{_libexecdir}/python*
%endif

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf
size 228314

3
urllib3-1.24.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:41c3db2fc01e5b907288010dec72f9d0a74e37d6994e6eb56849f59fea2265ae
size 229200

View File

@ -1,7 +1,7 @@
Index: urllib3-1.21.1/urllib3/util/ssl_.py
Index: urllib3-1.21.1/src/urllib3/util/ssl_.py
===================================================================
--- urllib3-1.21.1.orig/urllib3/util/ssl_.py
+++ urllib3-1.21.1/urllib3/util/ssl_.py
--- urllib3-1.21.1.orig/src/urllib3/util/ssl_.py
+++ urllib3-1.21.1/src/urllib3/util/ssl_.py
@@ -318,6 +318,8 @@ def ssl_wrap_socket(sock, keyfile=None,
elif getattr(context, 'load_default_certs', None) is not None:
# try to load OS default certs; works well on Windows (require Python3.4+)