You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update v2 migration guide to 2.4.0
* Fix version number deprecation
* Update ssl_version string in tests
* Adjust more test deprecation matches
* Bump 2.5.0 removals to 2.6.0
Any failures or deprecation warnings you receive should be fixed as urllib3 v2.1.0 will remove all
121
-
deprecated features. Many deprecation warnings will make suggestions about what to do to avoid the deprecated feature.
122
-
123
-
Warnings will look something like this:
124
-
125
-
.. code-block:: bash
126
-
127
-
DeprecationWarning: 'ssl_version' option is deprecated and will be removed
128
-
in urllib3 v2.1.0. Instead use 'ssl_minimum_version'
129
-
130
-
Continue removing deprecation warnings until there are no more. After this you can publish a new release of your package
131
-
that supports both urllib3 v1.26.x and v2.x.
132
-
133
-
.. note::
134
-
135
-
If you're not able to support both 1.26.x and v2.0 of urllib3 at the same time with your package please
136
-
`open an issue on GitHub <https://github.com/urllib3/urllib3/issues>`_ or reach out in
137
-
`our community Discord channel <https://discord.gg/urllib3>`_.
138
-
139
-
140
-
Migrating as an application developer?
141
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
142
-
143
-
If you're someone who writes Python but doesn't ship as a package (things like web services, data science, tools, and more) this section is for you.
144
-
145
-
Python environments only allow for one version of a dependency to be installed per environment which means
146
-
that **all of your dependencies using urllib3 need to support v2.0 for you to upgrade**.
147
-
148
-
The best way to visualize relationships between your dependencies is using `pipdeptree <https://pypi.org/project/pipdeptree>`_ and ``$ pipdeptree --reverse``:
149
-
150
-
.. code-block:: bash
151
-
152
-
# From inside your Python environment:
153
-
$ python -m pip install pipdeptree
154
-
# We only care about packages requiring urllib3
155
-
$ pipdeptree --reverse | grep "requires: urllib3"
156
-
157
-
- botocore==1.29.8 [requires: urllib3>=1.25.4,<2]
158
-
- requests==2.28.1 [requires: urllib3>=1.21.1,<2]
159
-
160
-
Reading the output from above, there are two packages which depend on urllib3: ``botocore`` and ``requests``.
161
-
The versions of these two packages both require urllib3 that is less than v2.0 (ie ``<2``).
162
-
163
-
Because both of these packages require urllib3 before v2.0 the new version of urllib3 can't be installed
164
-
by default. There are ways to force installing the newer version of urllib3 v2.0 (ie pinning to ``urllib3==2.0.0``)
165
-
which you can do to test your application.
166
-
167
-
It's important to know that even if you don't upgrade all of your services to 2.x
168
-
immediately you will `receive security fixes on the 1.26.x release stream <#security-fixes-for-urllib3-v1-26-x>` for some time.
169
-
170
44
171
-
Security fixes for urllib3 v1.26.x
172
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45
+
Sunsetting urllib3 1.26.x
46
+
~~~~~~~~~~~~~~~~~~~~~~~~~
173
47
174
-
Thanks to support from `Tidelift <https://tidelift.com/subscription/pkg/pypi-urllib3>`_
175
-
we're able to continue supporting the v1.26.x release stream with
176
-
security fixes for the foreseeable future 💖
48
+
urllib3 1.26.x is not currently maintained. urllib3 2.x is the best version of urllib3
49
+
and is widely supported by the larger Python ecosystem. That said, urllib3 1.26.x still
50
+
sees significant download numbers, mainly because the botocore package still requires
51
+
urllib3 1.26.x for Python 3.9 and earlier. If your organization would benefit from the
52
+
continued support of urllib3 1.26.x, please contact sethmichaellarson@gmail.com to
53
+
discuss sponsorship or contribution opportunities.
177
54
178
55
However, upgrading is still recommended as **no new feature developments or non-critical
179
56
bug fixes will be shipped to the 1.26.x release stream**.
180
57
181
-
If your organization relies on urllib3 and is interested in continuing support you can learn
182
-
more about the `Tidelift Subscription for Enterprise <https://tidelift.com/subscription/pkg/pypi-urllib3?utm_source=pypi-urllib3&utm_medium=referral&utm_campaign=docs>`_.
183
-
184
58
**🤔 Common upgrading issues**
185
-
-------------------------------
59
+
------------------------------
186
60
187
61
ssl module is compiled with OpenSSL 1.0.2.k-fips
188
62
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -194,15 +68,15 @@ ssl module is compiled with OpenSSL 1.0.2.k-fips
194
68
195
69
Remediation depends on your system:
196
70
197
-
- **AWS Lambda**: Upgrade to the Python3.10 runtime as it uses OpenSSL 1.1.1. Alternatively, you can
71
+
- **AWS Lambda**: Upgrade to the Python 3.10 (or later) runtime as it uses OpenSSL 1.1.1. Alternatively, you can
198
72
use a `custom Docker image
199
73
<https://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/>`_ and ensure you
200
74
use a Python build that uses OpenSSL 1.1.1 or later.
201
75
- **Amazon Linux 2**: Upgrade to `Amazon Linux 2023
202
76
<https://aws.amazon.com/linux/amazon-linux-2023/>`_. Alternatively, you can install OpenSSL 1.1.1
203
77
on Amazon Linux 2 using ``yum install openssl11 openssl11-devel`` and then install Python with a
204
78
tool like pyenv.
205
-
- **Red Hat Enterpritse Linux 7 (RHEL 7)**: Upgrade to RHEL 8 or RHEL 9.
79
+
- **Red Hat Enterpritse Linux 7 (RHEL 7)**: Upgrade to RHEL 8 or later.
206
80
- **Read the Docs**: Upgrade your `configuration file to use Ubuntu 22.04
207
81
<https://docs.readthedocs.io/en/stable/config-file/v2.html>`_ by using ``os: ubuntu-22.04`` in the
208
82
``build`` section. Feel free to use the `urllib3 configuration
@@ -228,12 +102,12 @@ library is unmaintained, but `replacements exist
228
102
This likely happens because you're using botocore which `does not support urllib3 2.0 yet
229
103
<https://github.com/boto/botocore/issues/2921>`_. The good news is that botocore explicitly declares
230
104
in its dependencies that it only supports ``urllib3<2``. Make sure to use a recent pip. That way, pip
231
-
will install urllib3 1.26.x until botocore starts supporting urllib3 2.0.
105
+
will install urllib3 1.26.x for versions of botocore that do not support urllib3 2.0.
232
106
233
-
If you're deploying to an AWS environment such as Lambda or a host using Amazon Linux 2,
234
-
you'll need to explicitly pin to ``urllib3<2`` in your project to ensure urllib3 2.0 isn't
235
-
brought into your environment. Otherwise, this may result in unintended side effects with
236
-
the default boto3 installation.
107
+
If you're deploying to an AWS environment such as Lambda with the Python 3.9 runtime or a host
108
+
using Amazon Linux 2, you'll need to explicitly pin to ``urllib3<2`` in your project to ensure
109
+
urllib3 2.0 isn't brought into your environment. Otherwise, this may result in unintended side
110
+
effects with the default boto3 installation.
237
111
238
112
AttributeError: module 'urllib3.connectionpool' has no attribute 'VerifiedHTTPSConnection'
@@ -251,18 +125,108 @@ AttributeError: 'HTTPResponse' object has no attribute 'strict'
251
125
252
126
The ``strict`` parameter is unneeded with Python 3 and should be removed.
253
127
254
-
Pinning urllib3<2
255
-
~~~~~~~~~~~~~~~~~
256
128
257
-
If the advice from the above sections did not help, you can pin urllib3 to 1.26.x by installing
258
-
``urllib3<2``. Please do **not** specify ``urllib3==1.26.15`` to make sure you continue getting
259
-
1.26.x updates!
260
129
261
-
While urllib3 1.26.x is still supported, it won't get new features or bug fixes, just security
262
-
updates. Consider opening a tracking issue to unpin urllib3 in the future to not stay on 1.26.x
263
-
indefinitely. For more details on the recommended way to handle your dependencies in general, see
264
-
`Semantic Versioning Will Not Save You <https://hynek.me/articles/semver-will-not-save-you/>`_. The
265
-
second half even uses urllib3 2.0 as an example!
130
+
Migrating as an application developer?
131
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
132
+
133
+
If you're someone who writes Python but doesn't ship as a package (things like web services, data science, tools, and more) this section is for you.
134
+
135
+
Python environments only allow for one version of a dependency to be installed per environment which means
136
+
that **all of your dependencies using urllib3 need to support 2.x for you to upgrade**.
137
+
138
+
The best way to visualize relationships between your dependencies is using `pipdeptree <https://pypi.org/project/pipdeptree>`_ and ``$ pipdeptree --reverse``:
0 commit comments