Projects
Mega:23.09
python-urllib3
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 3
View file
_service:tar_scm:python-urllib3.spec
Changed
@@ -2,7 +2,7 @@ %bcond_without tests Name: python-%{srcname} -Version: 1.26.16 +Version: 1.26.17 Release: 2 Summary: Sanity-friendly HTTP client for Python License: MIT @@ -10,6 +10,8 @@ Source0: https://github.com/urllib3/urllib3/archive/refs/tags/%{version}.tar.gz Source1: ssl_match_hostname_py3.py +Patch6001: backport-CVE-2023-45803-Made-body-stripped-from-HTTP-requests.patch + Patch0001: remove_mock.patch BuildArch: noarch @@ -76,6 +78,15 @@ %{python3_sitelib}/urllib3-*.egg-info %changelog +* Tue Oct 31 2023 chengyechun <chengyechun1@huawei.com> - 1.26.17-2 +- Type:CVE +- ID:CVE-2023-45803 +- SUG:NA +- DESC:fix CVE-2023-45803 Made body stripped form HTTP requests + +* Wed Oct 04 2023 Funda Wang <fundawang@yeah.net> - 1.26.17-1 +- Update to version 1.26.17 to fix CVE-2023-43804 + * Tue Aug 01 2023 chengyechun <chengyechun1@huawei.com> - 1.26.16-2 - Type:bugfix - CVE:NA
View file
_service:tar_scm:backport-CVE-2023-45803-Made-body-stripped-from-HTTP-requests.patch
Added
@@ -0,0 +1,126 @@ +From b594c5ceaca38e1ac215f916538fb128e3526a36 Mon Sep 17 00:00:00 2001 +From: Illia Volochii <illia.volochii@gmail.com> +Date: Tue, 17 Oct 2023 19:35:39 +0300 +Subject: PATCH Merge pull request from GHSA-g4mx-q9vg-27p4 + +Conflict:test/with_dummyserver/test_poolmanager.py and +test_connectionpool.py has not been modified because it has been deleted +in the pre-phase of the spec file +Reference:https://github.com/urllib3/urllib3/commit/b594c5ceaca38e1ac215f916538fb128e3526a36 + +--- + dummyserver/handlers.py | 7 +++++++ + src/urllib3/_collections.py | 19 +++++++++++++++++++ + src/urllib3/connectionpool.py | 5 +++++ + src/urllib3/poolmanager.py | 7 +++++-- + 4 files changed, 36 insertions(+), 2 deletions(-) + +diff --git a/dummyserver/handlers.py b/dummyserver/handlers.py +index c90c2fc..acd181d 100644 +--- a/dummyserver/handlers.py ++++ b/dummyserver/handlers.py +@@ -186,6 +186,8 @@ class TestingApp(RequestHandler): + status = request.params.get("status", "303 See Other") + if len(status) == 3: + status = "%s Redirect" % status.decode("latin-1") ++ elif isinstance(status, bytes): ++ status = status.decode("latin-1") + + headers = ("Location", target) + return Response(status=status, headers=headers) +@@ -264,6 +266,11 @@ class TestingApp(RequestHandler): + def headers(self, request): + return Response(json.dumps(dict(request.headers))) + ++ def headers_and_params(self, request): ++ return Response( ++ json.dumps({"headers": dict(request.headers), "params": request.params}) ++ ) ++ + def successful_retry(self, request): + """Handler which will return an error and then success + +diff --git a/src/urllib3/_collections.py b/src/urllib3/_collections.py +index da9857e..3672e30 100644 +--- a/src/urllib3/_collections.py ++++ b/src/urllib3/_collections.py +@@ -268,6 +268,25 @@ class HTTPHeaderDict(MutableMapping): + else: + return vals1: + ++ def _prepare_for_method_change(self): ++ """ ++ Remove content-specific header fields before changing the request ++ method to GET or HEAD according to RFC 9110, Section 15.4. ++ """ ++ ++ content_specific_headers = ++ "Content-Encoding", ++ "Content-Language", ++ "Content-Location", ++ "Content-Type", ++ "Content-Length", ++ "Digest", ++ "Last-Modified", ++ ++ for header in content_specific_headers: ++ self.discard(header) ++ return self ++ + # Backwards compatibility for httplib + getheaders = getlist + getallmatchingheaders = getlist +diff --git a/src/urllib3/connectionpool.py b/src/urllib3/connectionpool.py +index 96844d9..1fe9502 100644 +--- a/src/urllib3/connectionpool.py ++++ b/src/urllib3/connectionpool.py +@@ -9,6 +9,7 @@ import warnings + from socket import error as SocketError + from socket import timeout as SocketTimeout + ++from ._collections import HTTPHeaderDict + from .connection import ( + BaseSSLError, + BrokenPipeError, +@@ -843,7 +844,11 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods): + redirect_location = redirect and response.get_redirect_location() + if redirect_location: + if response.status == 303: ++ # Change the method according to RFC 9110, Section 15.4.4. + method = "GET" ++ # And lose the body not to transfer anything sensitive ++ body = None ++ headers = HTTPHeaderDict(headers)._prepare_for_method_change() + + try: + retries = retries.increment(method, url, response=response, _pool=self) +diff --git a/src/urllib3/poolmanager.py b/src/urllib3/poolmanager.py +index 14b10da..d69955a 100644 +--- a/src/urllib3/poolmanager.py ++++ b/src/urllib3/poolmanager.py +@@ -4,7 +4,7 @@ import collections + import functools + import logging + +-from ._collections import RecentlyUsedContainer ++from ._collections import HTTPHeaderDict, RecentlyUsedContainer + from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, port_by_scheme + from .exceptions import ( + LocationValueError, +@@ -382,9 +382,12 @@ class PoolManager(RequestMethods): + # Support relative URLs for redirecting. + redirect_location = urljoin(url, redirect_location) + +- # RFC 7231, Section 6.4.4 + if response.status == 303: ++ # Change the method according ro RFC 9110, Section 15.4.4. + method = "GET" ++ # And lose the body not to transfer anything sensitive. ++ kw"body" = None ++ kw"headers" = HTTPHeaderDict(kw"headers")._prepare_for_method_change() + + retries = kw.get("retries") + if not isinstance(retries, Retry): +-- +2.23.0 +
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="url">git@gitee.com:src-openeuler/python-urllib3.git</param> <param name="scm">git</param> - <param name="revision">openEuler-23.09</param> + <param name="revision">master</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
View file
_service:tar_scm:1.26.16.tar.gz/PKG-INFO
Deleted
@@ -1,1469 +0,0 @@ -Metadata-Version: 2.1 -Name: urllib3 -Version: 1.26.16 -Summary: HTTP library with thread-safe connection pooling, file post, and more. -Home-page: https://urllib3.readthedocs.io/ -Author: Andrey Petrov -Author-email: andrey.petrov@shazow.net -License: MIT -Project-URL: Documentation, https://urllib3.readthedocs.io/ -Project-URL: Code, https://github.com/urllib3/urllib3 -Project-URL: Issue tracker, https://github.com/urllib3/urllib3/issues -Keywords: urllib httplib threadsafe filepost http https ssl pooling -Classifier: Environment :: Web Environment -Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: MIT License -Classifier: Operating System :: OS Independent -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 -Classifier: Programming Language :: Python :: 3.8 -Classifier: Programming Language :: Python :: 3.9 -Classifier: Programming Language :: Python :: 3.10 -Classifier: Programming Language :: Python :: 3.11 -Classifier: Programming Language :: Python :: Implementation :: CPython -Classifier: Programming Language :: Python :: Implementation :: PyPy -Classifier: Topic :: Internet :: WWW/HTTP -Classifier: Topic :: Software Development :: Libraries -Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.* -Description-Content-Type: text/x-rst -Provides-Extra: brotli -Provides-Extra: secure -Provides-Extra: socks -License-File: LICENSE.txt - - -urllib3 is a powerful, *user-friendly* HTTP client for Python. Much of the -Python ecosystem already uses urllib3 and you should too. -urllib3 brings many critical features that are missing from the Python -standard libraries: - -- Thread safety. -- Connection pooling. -- Client-side SSL/TLS verification. -- File uploads with multipart encoding. -- Helpers for retrying requests and dealing with HTTP redirects. -- Support for gzip, deflate, and brotli encoding. -- Proxy support for HTTP and SOCKS. -- 100% test coverage. - -urllib3 is powerful and easy to use: - -.. code-block:: python - - >>> import urllib3 - >>> http = urllib3.PoolManager() - >>> r = http.request('GET', 'http://httpbin.org/robots.txt') - >>> r.status - 200 - >>> r.data - 'User-agent: *\nDisallow: /deny\n' - - -Installing ----------- - -urllib3 can be installed with `pip <https://pip.pypa.io>`_:: - - $ python -m pip install urllib3 - -Alternatively, you can grab the latest source code from `GitHub <https://github.com/urllib3/urllib3>`_:: - - $ git clone https://github.com/urllib3/urllib3.git - $ cd urllib3 - $ git checkout 1.26.x - $ pip install . - - -Documentation -------------- - -urllib3 has usage and reference documentation at `urllib3.readthedocs.io <https://urllib3.readthedocs.io>`_. - - -Contributing ------------- - -urllib3 happily accepts contributions. Please see our -`contributing documentation <https://urllib3.readthedocs.io/en/latest/contributing.html>`_ -for some tips on getting started. - - -Security Disclosures --------------------- - -To report a security vulnerability, please use the -`Tidelift security contact <https://tidelift.com/security>`_. -Tidelift will coordinate the fix and disclosure with maintainers. - - -Maintainers ------------ - -- `@sethmlarson <https://github.com/sethmlarson>`__ (Seth M. Larson) -- `@pquentin <https://github.com/pquentin>`__ (Quentin Pradet) -- `@theacodes <https://github.com/theacodes>`__ (Thea Flowers) -- `@haikuginger <https://github.com/haikuginger>`__ (Jess Shapiro) -- `@lukasa <https://github.com/lukasa>`__ (Cory Benfield) -- `@sigmavirus24 <https://github.com/sigmavirus24>`__ (Ian Stapleton Cordasco) -- `@shazow <https://github.com/shazow>`__ (Andrey Petrov) - -👋 - - -Sponsorship ------------ - -If your company benefits from this library, please consider `sponsoring its -development <https://urllib3.readthedocs.io/en/latest/sponsors.html>`_. - - -For Enterprise --------------- - -.. |tideliftlogo| image:: https://nedbatchelder.com/pix/Tidelift_Logos_RGB_Tidelift_Shorthand_On-White_small.png - :width: 75 - :alt: Tidelift - -.. list-table:: - :widths: 10 100 - - * - |tideliftlogo| - - Professional support for urllib3 is available as part of the `Tidelift - Subscription`_. Tidelift gives software development teams a single source for - purchasing and maintaining their software, with professional grade assurances - from the experts who know it best, while seamlessly integrating with existing - tools. - -.. _Tidelift Subscription: https://tidelift.com/subscription/pkg/pypi-urllib3?utm_source=pypi-urllib3&utm_medium=referral&utm_campaign=readme - - -Changes -======= - -1.26.16 (2023-05-23) --------------------- - -* Fixed thread-safety issue where accessing a ``PoolManager`` with many distinct origins - would cause connection pools to be closed while requests are in progress (`#2954 <https://github.com/urllib3/urllib3/pull/2954>`_) - - -1.26.15 (2023-03-10) --------------------- - -* Fix socket timeout value when ``HTTPConnection`` is reused (`#2645 <https://github.com/urllib3/urllib3/issues/2645>`__) -* Remove "!" character from the unreserved characters in IPv6 Zone ID parsing - (`#2899 <https://github.com/urllib3/urllib3/issues/2899>`__) -* Fix IDNA handling of '\x80' byte (`#2901 <https://github.com/urllib3/urllib3/issues/2901>`__) - -1.26.14 (2023-01-11) --------------------- - -* Fixed parsing of port 0 (zero) returning None, instead of 0. (`#2850 <https://github.com/urllib3/urllib3/issues/2850>`__) -* Removed deprecated getheaders() calls in contrib module. - -1.26.13 (2022-11-23) --------------------- - -* Deprecated the ``HTTPResponse.getheaders()`` and ``HTTPResponse.getheader()`` methods. -* Fixed an issue where parsing a URL with leading zeroes in the port would be rejected - even when the port number after removing the zeroes was valid. -* Fixed a deprecation warning when using cryptography v39.0.0. -* Removed the ``<4`` in the ``Requires-Python`` packaging metadata field. - - -1.26.12 (2022-08-22) --------------------- - -* Deprecated the `urllib3secure` extra and the `urllib3.contrib.pyopenssl` module. - Both will be removed in v2.x. See this `GitHub issue <https://github.com/urllib3/urllib3/issues/2680>`_ - for justification and info on how to migrate. - - -1.26.11 (2022-07-25) --------------------- - -* Fixed an issue where reading more than 2 GiB in a call to ``HTTPResponse.read`` would - raise an ``OverflowError`` on Python 3.9 and earlier. - - -1.26.10 (2022-07-07) --------------------- - -* Removed support for Python 3.5 -* Fixed an issue where a ``ProxyError`` recommending configuring the proxy as HTTP - instead of HTTPS could appear even when an HTTPS proxy wasn't configured. -
View file
_service:tar_scm:1.26.16.tar.gz/src/urllib3.egg-info
Deleted
-(directory)
View file
_service:tar_scm:1.26.16.tar.gz/src/urllib3.egg-info/PKG-INFO
Deleted
@@ -1,1469 +0,0 @@ -Metadata-Version: 2.1 -Name: urllib3 -Version: 1.26.16 -Summary: HTTP library with thread-safe connection pooling, file post, and more. -Home-page: https://urllib3.readthedocs.io/ -Author: Andrey Petrov -Author-email: andrey.petrov@shazow.net -License: MIT -Project-URL: Documentation, https://urllib3.readthedocs.io/ -Project-URL: Code, https://github.com/urllib3/urllib3 -Project-URL: Issue tracker, https://github.com/urllib3/urllib3/issues -Keywords: urllib httplib threadsafe filepost http https ssl pooling -Classifier: Environment :: Web Environment -Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: MIT License -Classifier: Operating System :: OS Independent -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 -Classifier: Programming Language :: Python :: 3.8 -Classifier: Programming Language :: Python :: 3.9 -Classifier: Programming Language :: Python :: 3.10 -Classifier: Programming Language :: Python :: 3.11 -Classifier: Programming Language :: Python :: Implementation :: CPython -Classifier: Programming Language :: Python :: Implementation :: PyPy -Classifier: Topic :: Internet :: WWW/HTTP -Classifier: Topic :: Software Development :: Libraries -Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.* -Description-Content-Type: text/x-rst -Provides-Extra: brotli -Provides-Extra: secure -Provides-Extra: socks -License-File: LICENSE.txt - - -urllib3 is a powerful, *user-friendly* HTTP client for Python. Much of the -Python ecosystem already uses urllib3 and you should too. -urllib3 brings many critical features that are missing from the Python -standard libraries: - -- Thread safety. -- Connection pooling. -- Client-side SSL/TLS verification. -- File uploads with multipart encoding. -- Helpers for retrying requests and dealing with HTTP redirects. -- Support for gzip, deflate, and brotli encoding. -- Proxy support for HTTP and SOCKS. -- 100% test coverage. - -urllib3 is powerful and easy to use: - -.. code-block:: python - - >>> import urllib3 - >>> http = urllib3.PoolManager() - >>> r = http.request('GET', 'http://httpbin.org/robots.txt') - >>> r.status - 200 - >>> r.data - 'User-agent: *\nDisallow: /deny\n' - - -Installing ----------- - -urllib3 can be installed with `pip <https://pip.pypa.io>`_:: - - $ python -m pip install urllib3 - -Alternatively, you can grab the latest source code from `GitHub <https://github.com/urllib3/urllib3>`_:: - - $ git clone https://github.com/urllib3/urllib3.git - $ cd urllib3 - $ git checkout 1.26.x - $ pip install . - - -Documentation -------------- - -urllib3 has usage and reference documentation at `urllib3.readthedocs.io <https://urllib3.readthedocs.io>`_. - - -Contributing ------------- - -urllib3 happily accepts contributions. Please see our -`contributing documentation <https://urllib3.readthedocs.io/en/latest/contributing.html>`_ -for some tips on getting started. - - -Security Disclosures --------------------- - -To report a security vulnerability, please use the -`Tidelift security contact <https://tidelift.com/security>`_. -Tidelift will coordinate the fix and disclosure with maintainers. - - -Maintainers ------------ - -- `@sethmlarson <https://github.com/sethmlarson>`__ (Seth M. Larson) -- `@pquentin <https://github.com/pquentin>`__ (Quentin Pradet) -- `@theacodes <https://github.com/theacodes>`__ (Thea Flowers) -- `@haikuginger <https://github.com/haikuginger>`__ (Jess Shapiro) -- `@lukasa <https://github.com/lukasa>`__ (Cory Benfield) -- `@sigmavirus24 <https://github.com/sigmavirus24>`__ (Ian Stapleton Cordasco) -- `@shazow <https://github.com/shazow>`__ (Andrey Petrov) - -👋 - - -Sponsorship ------------ - -If your company benefits from this library, please consider `sponsoring its -development <https://urllib3.readthedocs.io/en/latest/sponsors.html>`_. - - -For Enterprise --------------- - -.. |tideliftlogo| image:: https://nedbatchelder.com/pix/Tidelift_Logos_RGB_Tidelift_Shorthand_On-White_small.png - :width: 75 - :alt: Tidelift - -.. list-table:: - :widths: 10 100 - - * - |tideliftlogo| - - Professional support for urllib3 is available as part of the `Tidelift - Subscription`_. Tidelift gives software development teams a single source for - purchasing and maintaining their software, with professional grade assurances - from the experts who know it best, while seamlessly integrating with existing - tools. - -.. _Tidelift Subscription: https://tidelift.com/subscription/pkg/pypi-urllib3?utm_source=pypi-urllib3&utm_medium=referral&utm_campaign=readme - - -Changes -======= - -1.26.16 (2023-05-23) --------------------- - -* Fixed thread-safety issue where accessing a ``PoolManager`` with many distinct origins - would cause connection pools to be closed while requests are in progress (`#2954 <https://github.com/urllib3/urllib3/pull/2954>`_) - - -1.26.15 (2023-03-10) --------------------- - -* Fix socket timeout value when ``HTTPConnection`` is reused (`#2645 <https://github.com/urllib3/urllib3/issues/2645>`__) -* Remove "!" character from the unreserved characters in IPv6 Zone ID parsing - (`#2899 <https://github.com/urllib3/urllib3/issues/2899>`__) -* Fix IDNA handling of '\x80' byte (`#2901 <https://github.com/urllib3/urllib3/issues/2901>`__) - -1.26.14 (2023-01-11) --------------------- - -* Fixed parsing of port 0 (zero) returning None, instead of 0. (`#2850 <https://github.com/urllib3/urllib3/issues/2850>`__) -* Removed deprecated getheaders() calls in contrib module. - -1.26.13 (2022-11-23) --------------------- - -* Deprecated the ``HTTPResponse.getheaders()`` and ``HTTPResponse.getheader()`` methods. -* Fixed an issue where parsing a URL with leading zeroes in the port would be rejected - even when the port number after removing the zeroes was valid. -* Fixed a deprecation warning when using cryptography v39.0.0. -* Removed the ``<4`` in the ``Requires-Python`` packaging metadata field. - - -1.26.12 (2022-08-22) --------------------- - -* Deprecated the `urllib3secure` extra and the `urllib3.contrib.pyopenssl` module. - Both will be removed in v2.x. See this `GitHub issue <https://github.com/urllib3/urllib3/issues/2680>`_ - for justification and info on how to migrate. - - -1.26.11 (2022-07-25) --------------------- - -* Fixed an issue where reading more than 2 GiB in a call to ``HTTPResponse.read`` would - raise an ``OverflowError`` on Python 3.9 and earlier. - - -1.26.10 (2022-07-07) --------------------- - -* Removed support for Python 3.5 -* Fixed an issue where a ``ProxyError`` recommending configuring the proxy as HTTP - instead of HTTPS could appear even when an HTTPS proxy wasn't configured. -
View file
_service:tar_scm:1.26.16.tar.gz/src/urllib3.egg-info/SOURCES.txt
Deleted
@@ -1,135 +0,0 @@ -CHANGES.rst -LICENSE.txt -MANIFEST.in -README.rst -dev-requirements.txt -setup.cfg -setup.py -docs/Makefile -docs/advanced-usage.rst -docs/conf.py -docs/contributing.rst -docs/index.rst -docs/make.bat -docs/requirements.txt -docs/sponsors.rst -docs/user-guide.rst -docs/v2-roadmap.rst -docs/_static/banner.svg -docs/_static/dark-logo.svg -docs/images/demo-button.png -docs/images/favicon.png -docs/images/learn-more-button.png -docs/images/logo.png -docs/images/logo.svg -docs/reference/index.rst -docs/reference/urllib3.connection.rst -docs/reference/urllib3.connectionpool.rst -docs/reference/urllib3.exceptions.rst -docs/reference/urllib3.fields.rst -docs/reference/urllib3.poolmanager.rst -docs/reference/urllib3.request.rst -docs/reference/urllib3.response.rst -docs/reference/urllib3.util.rst -docs/reference/contrib/appengine.rst -docs/reference/contrib/index.rst -docs/reference/contrib/ntlmpool.rst -docs/reference/contrib/pyopenssl.rst -docs/reference/contrib/securetransport.rst -docs/reference/contrib/socks.rst -dummyserver/__init__.py -dummyserver/handlers.py -dummyserver/proxy.py -dummyserver/server.py -dummyserver/testcase.py -dummyserver/certs/README.rst -dummyserver/certs/cacert.key -dummyserver/certs/cacert.pem -dummyserver/certs/server.crt -dummyserver/certs/server.key -src/urllib3/__init__.py -src/urllib3/_collections.py -src/urllib3/_version.py -src/urllib3/connection.py -src/urllib3/connectionpool.py -src/urllib3/exceptions.py -src/urllib3/fields.py -src/urllib3/filepost.py -src/urllib3/poolmanager.py -src/urllib3/request.py -src/urllib3/response.py -src/urllib3.egg-info/PKG-INFO -src/urllib3.egg-info/SOURCES.txt -src/urllib3.egg-info/dependency_links.txt -src/urllib3.egg-info/requires.txt -src/urllib3.egg-info/top_level.txt -src/urllib3/contrib/__init__.py -src/urllib3/contrib/_appengine_environ.py -src/urllib3/contrib/appengine.py -src/urllib3/contrib/ntlmpool.py -src/urllib3/contrib/pyopenssl.py -src/urllib3/contrib/securetransport.py -src/urllib3/contrib/socks.py -src/urllib3/contrib/_securetransport/__init__.py -src/urllib3/contrib/_securetransport/bindings.py -src/urllib3/contrib/_securetransport/low_level.py -src/urllib3/packages/__init__.py -src/urllib3/packages/six.py -src/urllib3/packages/backports/__init__.py -src/urllib3/packages/backports/makefile.py -src/urllib3/packages/backports/weakref_finalize.py -src/urllib3/util/__init__.py -src/urllib3/util/connection.py -src/urllib3/util/proxy.py -src/urllib3/util/queue.py -src/urllib3/util/request.py -src/urllib3/util/response.py -src/urllib3/util/retry.py -src/urllib3/util/ssl_.py -src/urllib3/util/ssl_match_hostname.py -src/urllib3/util/ssltransport.py -src/urllib3/util/timeout.py -src/urllib3/util/url.py -src/urllib3/util/wait.py -test/__init__.py -test/benchmark.py -test/conftest.py -test/port_helpers.py -test/socketpair_helper.py -test/test_collections.py -test/test_compatibility.py -test/test_connection.py -test/test_connectionpool.py -test/test_exceptions.py -test/test_fields.py -test/test_filepost.py -test/test_no_ssl.py -test/test_poolmanager.py -test/test_proxymanager.py -test/test_queue_monkeypatch.py -test/test_response.py -test/test_retry.py -test/test_retry_deprecated.py -test/test_ssl.py -test/test_ssltransport.py -test/test_util.py -test/test_wait.py -test/tz_stub.py -test/appengine/__init__.py -test/appengine/conftest.py -test/appengine/test_gae_manager.py -test/appengine/test_urlfetch.py -test/contrib/__init__.py -test/contrib/duplicate_san.pem -test/contrib/test_pyopenssl.py -test/contrib/test_pyopenssl_dependencies.py -test/contrib/test_securetransport.py -test/contrib/test_socks.py -test/with_dummyserver/__init__.py -test/with_dummyserver/test_chunked_transfer.py -test/with_dummyserver/test_connectionpool.py -test/with_dummyserver/test_https.py -test/with_dummyserver/test_no_ssl.py -test/with_dummyserver/test_poolmanager.py -test/with_dummyserver/test_proxy_poolmanager.py -test/with_dummyserver/test_socketlevel.py \ No newline at end of file
View file
_service:tar_scm:1.26.16.tar.gz/src/urllib3.egg-info/dependency_links.txt
Deleted
@@ -1,1 +0,0 @@ -
View file
_service:tar_scm:1.26.16.tar.gz/src/urllib3.egg-info/requires.txt
Deleted
@@ -1,24 +0,0 @@ - -brotli - -brotli:(os_name != "nt" or python_version >= "3") and platform_python_implementation != "CPython" -brotlicffi>=0.8.0 - -brotli:(os_name != "nt" or python_version >= "3") and platform_python_implementation == "CPython" -brotli>=1.0.9 - -brotli:os_name == "nt" and python_version < "3" -brotlipy>=0.6.0 - -secure -pyOpenSSL>=0.14 -cryptography>=1.3.4 -idna>=2.0.0 -certifi -urllib3-secure-extra - -secure:python_version == "2.7" -ipaddress - -socks -PySocks!=1.5.7,<2.0,>=1.5.6
View file
_service:tar_scm:1.26.16.tar.gz/src/urllib3.egg-info/top_level.txt
Deleted
@@ -1,1 +0,0 @@ -urllib3
View file
_service:tar_scm:1.26.17.tar.gz/.coveragerc
Added
@@ -0,0 +1,29 @@ +run +source = + urllib3 + +omit = + *urllib3/packages/* + *urllib3/contrib/appengine.py + *urllib3/contrib/ntlmpool.py + *urllib3/contrib/pyopenssl.py + *urllib3/contrib/securetransport.py + *urllib3/contrib/_securetransport/* + +paths +source = + src/urllib3 + */urllib3 + *\urllib3 + +report +exclude_lines = + except ModuleNotFoundError: + except ImportError: + pass + import + raise + .* # Platform-specific.* + .*:.* # Python \d.* + .* # Abstract + .* # Defensive:
View file
_service:tar_scm:1.26.17.tar.gz/.github
Added
+(directory)
View file
_service:tar_scm:1.26.17.tar.gz/.github/CODEOWNERS
Added
@@ -0,0 +1,9 @@ +# Restrict all files related to deploying to +# require lead maintainer approval. + +.github/workflows/ @sethmlarson @pquentin @shazow +.github/CODEOWNERS @sethmlarson @pquentin @shazow +src/urllib3/_version.py @sethmlarson @pquentin @shazow +setup.py @sethmlarson @pquentin @shazow +pyproject.toml @sethmlarson @pquentin @shazow +ci/ @sethmlarson @pquentin @shazow
View file
_service:tar_scm:1.26.17.tar.gz/.github/FUNDING.yml
Added
@@ -0,0 +1,3 @@ +tidelift: pypi/urllib3 +open_collective: urllib3 +custom: https://gitcoin.co/grants/65/urllib3
View file
_service:tar_scm:1.26.17.tar.gz/.github/ISSUE_TEMPLATE
Added
+(directory)
View file
_service:tar_scm:1.26.17.tar.gz/.github/ISSUE_TEMPLATE/01_feature_request.md
Added
@@ -0,0 +1,26 @@ +--- +name: 🎁 Feature Request +about: Suggest a new feature +--- + +### Context + +What are you trying to do? +How do you expect to do it? +Is it something you currently cannot do? +Is this related to an existing issue/problem? + +### Alternatives + +Can you achieve the same result doing it in an alternative way? +Is the alternative considerable? + +### Duplicate + +Has the feature been requested before? +If so, please provide a link to the issue. + +### Contribution + +Would you be willing to submit a PR? +_(Help can be provided if you need assistance submitting a PR)_
View file
_service:tar_scm:1.26.17.tar.gz/.github/ISSUE_TEMPLATE/02_bug_report.md
Added
@@ -0,0 +1,35 @@ +--- +name: 🐞 Bug Report +about: Something is broken +--- + +### Subject + +Describe the issue here. + +### Environment + +Describe your environment. +At least, paste here the output of: + +```python +import platform +import urllib3 + +print("OS", platform.platform()) +print("Python", platform.python_version()) +print("urllib3", urllib3.__version__) +``` + +### Steps to Reproduce + +A simple and isolated way to reproduce the issue. A code snippet would be great. + +### Expected Behavior + +What should happen. + +### Actual Behavior + +What happens instead. +You may attach logs, packet captures, etc.
View file
_service:tar_scm:1.26.17.tar.gz/.github/ISSUE_TEMPLATE/config.yml
Added
@@ -0,0 +1,11 @@ +blank_issues_enabled: false +contact_links: + - name: 📚 Documentation + url: https://urllib3.readthedocs.io/en/latest/ + about: Make sure you read the relevant docs + - name: ❓ Ask on StackOverflow + url: https://stackoverflow.com/questions/tagged/urllib3 + about: Ask questions about usage in StackOverflow + - name: 💬 Ask the Community + url: https://discord.gg/CHEgCZN + about: Join urllib3's Discord server
View file
_service:tar_scm:1.26.17.tar.gz/.github/PULL_REQUEST_TEMPLATE.md
Added
@@ -0,0 +1,8 @@ +<!--- +Thanks for your contribution! ♥️ + +If this is your first PR to urllib3 please review the Contributing Guide: +https://urllib3.readthedocs.io/en/latest/contributing.html + +Adhering to the Contributing Guide means we can review, merge, and release your change faster! :) +--->
View file
_service:tar_scm:1.26.17.tar.gz/.github/workflows
Added
+(directory)
View file
_service:tar_scm:1.26.17.tar.gz/.github/workflows/ci.yml
Added
@@ -0,0 +1,155 @@ +name: CI + +on: push, pull_request + +permissions: "read-all" + +defaults: + run: + shell: bash + +jobs: + package: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v4 + with: + python-version: "3.7" + - name: Check packages + run: | + python3.7 -m pip install pip setuptools wheel twine rstcheck; + python3.7 setup.py sdist bdist_wheel; + rstcheck README.rst CHANGES.rst + python3.7 -m twine check dist/* + test: + strategy: + fail-fast: false + matrix: + python-version: "2.7", "3.6", "3.7", "3.8", "3.9", "3.10" + os: macos-11, windows-latest, ubuntu-latest + experimental: false + nox-session: '' + exclude: + # GitHub Actions dropped support for Python 2.7 and 3.7 in Ubuntu 22.04 + - python-version: "2.7" + os: ubuntu-latest + - python-version: "3.6" + os: ubuntu-latest + # Python 3.7 does not fully support OpenSSL 3, the default on Ubuntu 22.04 + # https://bugs.python.org/issue38820 + - python-version: "3.7" + os: ubuntu-latest + include: + - python-version: "2.7" + os: ubuntu-20.04 + experimental: false + nox-session: '' + - python-version: "3.6" + os: ubuntu-20.04 + experimental: false + nox-session: '' + - python-version: "3.7" + os: ubuntu-20.04 + experimental: false + nox-session: '' + - python-version: "pypy3.9" + os: ubuntu-latest + experimental: false + nox-session: test-pypy + - python-version: "pypy2.7" + os: ubuntu-20.04 + experimental: false + nox-session: test-pypy + - python-version: "2.7" + os: ubuntu-latest + experimental: false + nox-session: google_brotli-2.7 + - python-version: "3.x" + os: ubuntu-latest + experimental: false + nox-session: google_brotli-3 + - python-version: "2.7" + os: ubuntu-latest + experimental: false + nox-session: app_engine + - python-version: 3.11-dev + os: ubuntu-latest + experimental: true + nox-session: test-3.11 + + runs-on: ${{ matrix.os }} + name: ${{ fromJson('{"macos-11":"macOS","windows-latest":"Windows","ubuntu-20.04":"Ubuntu 20.04","ubuntu-latest":"Ubuntu"}')matrix.os }} ${{ matrix.python-version }} ${{ matrix.nox-session}} + continue-on-error: ${{ matrix.experimental }} + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Set Up Python - ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Set Up Python 3 to run nox + if: matrix.python-version == '2.7' || matrix.python-version == 'pypy2.7' + uses: actions/setup-python@v4 + with: + python-version: "3" + + - if: matrix.python-version == '2.7' || matrix.python-version == 'pypy2.7' + name: Install Dependencies + run: python -m pip install --upgrade pip setuptools nox 'virtualenv<20.22.0' + + - if: matrix.python-version != '2.7' && matrix.python-version != 'pypy2.7' + name: Install Dependencies + run: python -m pip install --upgrade pip setuptools nox + + - name: Run Tests + run: ./ci/run_tests.sh + env: + PYTHON_VERSION: ${{ matrix.python-version }} + NOX_SESSION: ${{ matrix.nox-session }} + + - name: Upload Coverage + if: ${{ matrix.nox-session != 'unsupported_python2' }} + uses: "actions/upload-artifact@v2" + with: + name: coverage-data + path: ".coverage.*" + if-no-files-found: error + + + coverage: + if: always() + runs-on: "ubuntu-latest" + needs: test + steps: + - uses: actions/checkout@v2 + - name: "Use latest Python so it understands all syntax" + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: "Install coverage" + run: "python -m pip install --upgrade coverage" + + - name: "Download coverage data" + uses: actions/download-artifact@v2 + with: + name: coverage-data + + - name: "Combine & check coverage" + run: | + python -m coverage combine + python -m coverage html --skip-covered --skip-empty + python -m coverage report --ignore-errors --show-missing --fail-under=100 + + - name: "Upload report if check failed" + uses: actions/upload-artifact@v2 + with: + name: coverage-report + path: htmlcov + if: ${{ failure() }}
View file
_service:tar_scm:1.26.17.tar.gz/.github/workflows/integration.yml
Added
@@ -0,0 +1,32 @@ +name: Downstream + +on: + pull_request: + paths: + - "src/urllib3/_version.py" + +permissions: "read-all" + +jobs: + integration: + strategy: + fail-fast: false + matrix: + python-version: "3.10" + downstream: botocore, requests + + runs-on: ubuntu-22.04 + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Set Up Python - ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Dependencies + run: python -m pip install --upgrade nox + - name: Run downstream tests + run: nox -s downstream_${{ matrix.downstream }}-${{ matrix.python-version }}
View file
_service:tar_scm:1.26.17.tar.gz/.github/workflows/lint.yml
Added
@@ -0,0 +1,20 @@ +name: lint + +on: push, pull_request + +permissions: "read-all" + +jobs: + lint: + runs-on: ubuntu-20.04 + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: "3.8" + - name: Lint the code + uses: pre-commit/action@v2.0.0 +
View file
_service:tar_scm:1.26.17.tar.gz/.github/workflows/publish.yml
Added
@@ -0,0 +1,87 @@ +name: Publish to PyPI + +on: + push: + tags: + - "*" + +permissions: + contents: "read" + # Needed to access the workflow's OIDC identity. + id-token: "write" + +jobs: + build: + name: "Build dists" + runs-on: "ubuntu-latest" + environment: + name: "publish" + outputs: + hashes: ${{ steps.hash.outputs.hashes }} + + steps: + - name: "Checkout repository" + uses: "actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8" + + - name: "Setup Python" + uses: "actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984" + with: + python-version: "3.x" + + - name: "Install dependencies" + run: python -m pip install build==0.8.0 + + - name: "Build dists" + run: | + SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) \ + python -m build + + - name: "Generate hashes" + id: hash + run: | + cd dist && echo "::set-output name=hashes::$(sha256sum * | base64 -w0)" + + - name: "Upload dists" + uses: "actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb" + with: + name: "dist" + path: "dist/" + if-no-files-found: error + retention-days: 5 + + provenance: + needs: build + permissions: + actions: read + contents: write + id-token: write + uses: "slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.2.1" + with: + base64-subjects: "${{ needs.build.outputs.hashes }}" + upload-assets: true + compile-generator: true # Workaround for https://github.com/slsa-framework/slsa-github-generator/issues/1163 + + publish: + name: "Publish" + if: startsWith(github.ref, 'refs/tags/') + needs: "build", "provenance" + permissions: + contents: write + id-token: write # Needed for trusted publishing to PyPI. + runs-on: "ubuntu-latest" + + steps: + - name: "Download dists" + uses: "actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7" + with: + name: "dist" + path: "dist/" + + - name: "Upload dists to GitHub Release" + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + run: | + gh release upload ${{ github.ref_name }} dist/* --repo ${{ github.repository }} + + - name: "Publish dists to PyPI" + uses: "pypa/gh-action-pypi-publish@a56da0b891b3dc519c7ee3284aff1fad93cc8598"
View file
_service:tar_scm:1.26.17.tar.gz/.gitignore
Added
@@ -0,0 +1,10 @@ +.* +!/.github/ +*.pyco +*.egg +*.egg-info +*.log +/dist +/build +/docs/_build +coverage.xml
View file
_service:tar_scm:1.26.17.tar.gz/.pre-commit-config.yaml
Added
@@ -0,0 +1,18 @@ +repos: + - repo: https://github.com/psf/black + rev: 21.12b0 + hooks: + - id: black + additional_dependencies: '.python2', 'click==8.0.4' + args: "--target-version", "py27" + + - repo: https://github.com/PyCQA/isort + rev: 5.12.0 + hooks: + - id: isort + + - repo: https://github.com/pycqa/flake8 + rev: 3.9.2 + hooks: + - id: flake8 + additional_dependencies: flake8-2020
View file
_service:tar_scm:1.26.17.tar.gz/.readthedocs.yml
Added
@@ -0,0 +1,19 @@ +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3" + +python: + install: + - method: pip + path: . + extra_requirements: + - brotli + - secure + - socks + - requirements: docs/requirements.txt + +sphinx: + fail_on_warning: true
View file
_service:tar_scm:1.26.16.tar.gz/CHANGES.rst -> _service:tar_scm:1.26.17.tar.gz/CHANGES.rst
Changed
@@ -1,6 +1,12 @@ Changes ======= +1.26.17 (2023-10-02) +-------------------- + +* Added the ``Cookie`` header to the list of headers to strip from requests when redirecting to a different host. As before, different headers can be set via ``Retry.remove_headers_on_redirect``. + + 1.26.16 (2023-05-23) --------------------
View file
_service:tar_scm:1.26.17.tar.gz/CODE_OF_CONDUCT.md
Added
@@ -0,0 +1,128 @@ + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at @sethmlarson or @shazow. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenanthomepage, +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by Mozilla's code of conduct +enforcement ladder(https://github.com/mozilla/diversity). + +homepage: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations.
View file
_service:tar_scm:1.26.17.tar.gz/ci
Added
+(directory)
View file
_service:tar_scm:1.26.17.tar.gz/ci/deploy.sh
Added
@@ -0,0 +1,7 @@ +#!/bin/bash + +set -exo pipefail + +python3 -m pip install --upgrade twine wheel +python3 setup.py sdist bdist_wheel +python3 -m twine upload dist/* -u $PYPI_USERNAME -p $PYPI_PASSWORD --skip-existing
View file
_service:tar_scm:1.26.17.tar.gz/ci/run_tests.sh
Added
@@ -0,0 +1,14 @@ +#!/bin/bash + + +if "${NOX_SESSION}" == "app_engine" ; then + export GAE_SDK_PATH=$HOME/.cache/google_appengine + python2 -m pip install gcp-devrel-py-tools==0.0.16 + gcp-devrel-py-tools download-appengine-sdk "$(dirname ${GAE_SDK_PATH})" +fi + +if -z "$NOX_SESSION" ; then + cat /etc/hosts + NOX_SESSION=test-${PYTHON_VERSION%-dev} +fi +nox -s $NOX_SESSION --error-on-missing-interpreters
View file
_service:tar_scm:1.26.16.tar.gz/docs/requirements.txt -> _service:tar_scm:1.26.17.tar.gz/docs/requirements.txt
Changed
@@ -1,4 +1,4 @@ -r ../dev-requirements.txt sphinx>3.0.0 -requests>=2,<2.16 +requests>=2 furo
View file
_service:tar_scm:1.26.17.tar.gz/noxfile.py
Added
@@ -0,0 +1,153 @@ +import os +import shutil +import subprocess + +import nox + +SOURCE_FILES = + "docs/", + "dummyserver/", + "src/", + "test/", + "noxfile.py", + "setup.py", + + + +def tests_impl(session, extras="socks,secure,brotli"): + # Install deps and the package itself. + session.install("-r", "dev-requirements.txt") + session.install(".{extras}".format(extras=extras)) + + # Show the pip version. + session.run("pip", "--version") + # Print the Python version and bytesize. + session.run("python", "--version") + session.run("python", "-c", "import struct; print(struct.calcsize('P') * 8)") + # Print OpenSSL information. + session.run("python", "-m", "OpenSSL.debug") + + # Inspired from https://hynek.me/articles/ditch-codecov-python/ + # We use parallel mode and then combine in a later CI step + session.run( + "coverage", + "run", + "--parallel-mode", + "-m", + "pytest", + "-r", + "a", + f"--color={'yes' if 'GITHUB_ACTIONS' in os.environ else 'auto'}", + "--tb=native", + "--no-success-flaky-report", + *(session.posargs or ("test/",)), + env={"PYTHONWARNINGS": "always::DeprecationWarning"}, + ) + + +@nox.session(python="2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "pypy") +def test(session): + tests_impl(session) + + +@nox.session(python="2.7", "3") +def google_brotli(session): + # https://pypi.org/project/Brotli/ is the Google version of brotli, so + # install it separately and don't install our brotli extra (which installs + # brotlipy). + session.install("brotli") + tests_impl(session, extras="socks,secure") + + +@nox.session(python="2.7") +def app_engine(session): + session.install("-r", "dev-requirements.txt") + session.install(".") + session.run( + "coverage", + "run", + "--parallel-mode", + "-m", + "pytest", + "-r", + "sx", + "test/appengine", + *session.posargs, + ) + + +def git_clone(session, git_url): + session.run("git", "clone", "--depth", "1", git_url, external=True) + + +@nox.session(python="3.10") +def downstream_botocore(session): + root = os.getcwd() + tmp_dir = session.create_tmp() + + session.cd(tmp_dir) + git_clone(session, "https://github.com/boto/botocore") + session.chdir("botocore") + session.run("git", "rev-parse", "HEAD", external=True) + session.run("python", "scripts/ci/install") + + session.cd(root) + session.install(".", silent=False) + session.cd(f"{tmp_dir}/botocore") + + session.run("python", "scripts/ci/run-tests") + + +@nox.session(python="3.10") +def downstream_requests(session): + root = os.getcwd() + tmp_dir = session.create_tmp() + + session.cd(tmp_dir) + git_clone(session, "https://github.com/psf/requests") + session.chdir("requests") + session.run("git", "rev-parse", "HEAD", external=True) + session.install(".socks", silent=False) + session.install("-r", "requirements-dev.txt", silent=False) + + session.cd(root) + session.install(".", silent=False) + session.cd(f"{tmp_dir}/requests") + + session.run("pytest", "tests") + + +@nox.session() +def format(session): + """Run code formatters.""" + session.install("pre-commit") + session.run("pre-commit", "--version") + + process = subprocess.run( + "pre-commit", "run", "--all-files", + env=session.env, + text=True, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + ) + # Ensure that pre-commit itself ran successfully + assert process.returncode in (0, 1) + + lint(session) + + +@nox.session +def lint(session): + session.install("pre-commit") + session.run("pre-commit", "run", "--all-files") + + +@nox.session +def docs(session): + session.install("-r", "docs/requirements.txt") + session.install(".socks,secure,brotli") + + session.chdir("docs") + if os.path.exists("_build"): + shutil.rmtree("_build") + session.run("sphinx-build", "-b", "html", "-W", ".", "_build/html")
View file
_service:tar_scm:1.26.16.tar.gz/setup.cfg -> _service:tar_scm:1.26.17.tar.gz/setup.cfg
Changed
@@ -1,37 +1,32 @@ flake8 ignore = E501, E203, W503, W504 -exclude = ./docs/conf.py,./src/urllib3/packages/* -max-line-length = 99 +exclude=./docs/conf.py,./src/urllib3/packages/* +max-line-length=99 bdist_wheel universal = 1 metadata license_file = LICENSE.txt -provides-extra = - secure - socks - brotli -requires-dist = - pyOpenSSL>=0.14; extra == 'secure' - cryptography>=1.3.4; extra == 'secure' - idna>=2.0.0; extra == 'secure' - certifi; extra == 'secure' - ipaddress; python_version=="2.7" and extra == 'secure' - urllib3-secure-extra; extra == 'secure' - PySocks>=1.5.6,<2.0,!=1.5.7; extra == 'socks' - brotli>=1.0.9; (os_name != 'nt' or python_version >= '3') and platform_python_implementation == 'CPython' and extra == 'brotli' - brotlicffi>=0.8.0; (os_name != 'nt' or python_version >= '3') and platform_python_implementation != 'CPython' and extra == 'brotli' - brotlipy>=0.6.0; os_name == 'nt' and python_version < '3' and extra == 'brotli' +provides-extra = + secure + socks + brotli +requires-dist = + pyOpenSSL>=0.14; extra == 'secure' + cryptography>=1.3.4; extra == 'secure' + idna>=2.0.0; extra == 'secure' + certifi; extra == 'secure' + ipaddress; python_version=="2.7" and extra == 'secure' + urllib3-secure-extra; extra == 'secure' + PySocks>=1.5.6,<2.0,!=1.5.7; extra == 'socks' + brotli>=1.0.9; (os_name != 'nt' or python_version >= '3') and platform_python_implementation == 'CPython' and extra == 'brotli' + brotlicffi>=0.8.0; (os_name != 'nt' or python_version >= '3') and platform_python_implementation != 'CPython' and extra == 'brotli' + brotlipy>=0.6.0; os_name == 'nt' and python_version < '3' and extra == 'brotli' tool:pytest xfail_strict = true python_classes = Test *TestCase isort -profile = black - -egg_info -tag_build = -tag_date = 0 - +profile=black
View file
_service:tar_scm:1.26.16.tar.gz/setup.py -> _service:tar_scm:1.26.17.tar.gz/setup.py
Changed
@@ -85,7 +85,9 @@ python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*", extras_require={ "brotli": - "brotli>=1.0.9; (os_name != 'nt' or python_version >= '3') and platform_python_implementation == 'CPython'", + # https://github.com/google/brotli/issues/1074 + "brotli==1.0.9; os_name != 'nt' and python_version < '3' and platform_python_implementation == 'CPython'", + "brotli>=1.0.9; python_version >= '3' and platform_python_implementation == 'CPython'", "brotlicffi>=0.8.0; (os_name != 'nt' or python_version >= '3') and platform_python_implementation != 'CPython'", "brotlipy>=0.6.0; os_name == 'nt' and python_version < '3'", ,
View file
_service:tar_scm:1.26.16.tar.gz/src/urllib3/_version.py -> _service:tar_scm:1.26.17.tar.gz/src/urllib3/_version.py
Changed
@@ -1,2 +1,2 @@ # This file is protected via CODEOWNERS -__version__ = "1.26.16" +__version__ = "1.26.17"
View file
_service:tar_scm:1.26.16.tar.gz/src/urllib3/request.py -> _service:tar_scm:1.26.17.tar.gz/src/urllib3/request.py
Changed
@@ -1,6 +1,9 @@ from __future__ import absolute_import +import sys + from .filepost import encode_multipart_formdata +from .packages import six from .packages.six.moves.urllib.parse import urlencode __all__ = "RequestMethods" @@ -168,3 +171,21 @@ extra_kw.update(urlopen_kw) return self.urlopen(method, url, **extra_kw) + + +if not six.PY2: + + class RequestModule(sys.modules__name__.__class__): + def __call__(self, *args, **kwargs): + """ + If user tries to call this module directly urllib3 v2.x style raise an error to the user + suggesting they may need urllib3 v2 + """ + raise TypeError( + "'module' object is not callable\n" + "urllib3.request() method is not supported in this release, " + "upgrade to urllib3 v2 to use it\n" + "see https://urllib3.readthedocs.io/en/stable/v2-migration-guide.html" + ) + + sys.modules__name__.__class__ = RequestModule
View file
_service:tar_scm:1.26.16.tar.gz/src/urllib3/util/retry.py -> _service:tar_scm:1.26.17.tar.gz/src/urllib3/util/retry.py
Changed
@@ -235,7 +235,7 @@ RETRY_AFTER_STATUS_CODES = frozenset(413, 429, 503) #: Default headers to be used for ``remove_headers_on_redirect`` - DEFAULT_REMOVE_HEADERS_ON_REDIRECT = frozenset("Authorization") + DEFAULT_REMOVE_HEADERS_ON_REDIRECT = frozenset("Cookie", "Authorization") #: Maximum backoff time. DEFAULT_BACKOFF_MAX = 120
View file
_service:tar_scm:1.26.17.tar.gz/test/test_request.py
Added
@@ -0,0 +1,26 @@ +import types + +import pytest + +import urllib3 +from urllib3.packages import six + + +@pytest.mark.skipif( + six.PY2, + reason="This behaviour isn't added when running urllib3 in Python 2", +) +class TestRequestImport(object): + def test_request_import_error(self): + """Ensure an appropriate error is raised to the user + if they try and run urllib3.request()""" + with pytest.raises(TypeError) as exc_info: + urllib3.request(1, a=2) + assert "urllib3 v2" in exc_info.value.args0 + + def test_request_module_properties(self): + """Ensure properties of the overridden request module + are still present""" + assert isinstance(urllib3.request, types.ModuleType) + expected_attrs = {"RequestMethods", "encode_multipart_formdata", "urlencode"} + assert set(dir(urllib3.request)).issuperset(expected_attrs)
View file
_service:tar_scm:1.26.16.tar.gz/test/test_retry.py -> _service:tar_scm:1.26.17.tar.gz/test/test_retry.py
Changed
@@ -293,12 +293,12 @@ def test_retry_default_remove_headers_on_redirect(self): retry = Retry() - assert list(retry.remove_headers_on_redirect) == "authorization" + assert retry.remove_headers_on_redirect == {"authorization", "cookie"} def test_retry_set_remove_headers_on_redirect(self): retry = Retry(remove_headers_on_redirect="X-API-Secret") - assert list(retry.remove_headers_on_redirect) == "x-api-secret" + assert retry.remove_headers_on_redirect == {"x-api-secret"} @pytest.mark.parametrize("value", "-1", "+1", "1.0", six.u("\xb2")) # \xb2 = ^2 def test_parse_retry_after_invalid(self, value):
View file
_service:tar_scm:1.26.16.tar.gz/test/test_retry_deprecated.py -> _service:tar_scm:1.26.17.tar.gz/test/test_retry_deprecated.py
Changed
@@ -295,7 +295,7 @@ def test_retry_default_remove_headers_on_redirect(self): retry = Retry() - assert list(retry.remove_headers_on_redirect) == "authorization" + assert retry.remove_headers_on_redirect == {"authorization", "cookie"} def test_retry_set_remove_headers_on_redirect(self): retry = Retry(remove_headers_on_redirect="X-API-Secret")
View file
_service:tar_scm:1.26.16.tar.gz/test/with_dummyserver/test_poolmanager.py -> _service:tar_scm:1.26.17.tar.gz/test/with_dummyserver/test_poolmanager.py
Changed
@@ -141,7 +141,7 @@ "GET", "%s/redirect" % self.base_url, fields={"target": "%s/headers" % self.base_url_alt}, - headers={"Authorization": "foo"}, + headers={"Authorization": "foo", "Cookie": "foo=bar"}, ) assert r.status == 200 @@ -149,12 +149,13 @@ data = json.loads(r.data.decode("utf-8")) assert "Authorization" not in data + assert "Cookie" not in data r = http.request( "GET", "%s/redirect" % self.base_url, fields={"target": "%s/headers" % self.base_url_alt}, - headers={"authorization": "foo"}, + headers={"authorization": "foo", "cookie": "foo=bar"}, ) assert r.status == 200 @@ -163,6 +164,8 @@ assert "authorization" not in data assert "Authorization" not in data + assert "cookie" not in data + assert "Cookie" not in data def test_redirect_cross_host_no_remove_headers(self): with PoolManager() as http: @@ -170,7 +173,7 @@ "GET", "%s/redirect" % self.base_url, fields={"target": "%s/headers" % self.base_url_alt}, - headers={"Authorization": "foo"}, + headers={"Authorization": "foo", "Cookie": "foo=bar"}, retries=Retry(remove_headers_on_redirect=), ) @@ -179,6 +182,7 @@ data = json.loads(r.data.decode("utf-8")) assert data"Authorization" == "foo" + assert data"Cookie" == "foo=bar" def test_redirect_cross_host_set_removed_headers(self): with PoolManager() as http: @@ -186,7 +190,11 @@ "GET", "%s/redirect" % self.base_url, fields={"target": "%s/headers" % self.base_url_alt}, - headers={"X-API-Secret": "foo", "Authorization": "bar"}, + headers={ + "X-API-Secret": "foo", + "Authorization": "bar", + "Cookie": "foo=bar", + }, retries=Retry(remove_headers_on_redirect="X-API-Secret"), ) @@ -196,12 +204,17 @@ assert "X-API-Secret" not in data assert data"Authorization" == "bar" + assert data"Cookie" == "foo=bar" r = http.request( "GET", "%s/redirect" % self.base_url, fields={"target": "%s/headers" % self.base_url_alt}, - headers={"x-api-secret": "foo", "authorization": "bar"}, + headers={ + "x-api-secret": "foo", + "authorization": "bar", + "cookie": "foo=bar", + }, retries=Retry(remove_headers_on_redirect="X-API-Secret"), ) @@ -212,6 +225,7 @@ assert "x-api-secret" not in data assert "X-API-Secret" not in data assert data"Authorization" == "bar" + assert data"Cookie" == "foo=bar" def test_redirect_without_preload_releases_connection(self): with PoolManager(block=True, maxsize=2) as http:
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2