pypa / twine

Utilities for interacting with PyPI
https://twine.readthedocs.io/
Apache License 2.0
1.61k stars 308 forks source link

Can not work with urllib3 >= 2.0 #997

Closed reswqa closed 1 year ago

reswqa commented 1 year ago

Your Environment

Thank you for taking the time to report an issue.

To more efficiently resolve this issue, we'd like to know some basic information about your system and setup.

1) Your operating system:

MacOs(13.2.1 (22D68)).

2) Version of python you are running: Python 3.11.2

3) How did you install twine? Did you use your operating system's package manager or pip or something else? pip3 install

4) Version of twine you have installed (include complete output of): 1.12.0

5) Which package repository are you targeting? --repository-url https://upload.pypi.org/legacy/

The Issue

twine upload --repository-url https://upload.pypi.org/legacy/ xxx reporting some error:

image

It seems that the param method_whitelist is deprecated at urllib3 v1.26.0 and removed in 2.x, but we only requires urllib3 >= 1.26.0. If I have a 2.x urllib3, there will be a problem.

Steps to Reproduce

Install requests v2.30 and upload some package to PYPI.

sigmavirus24 commented 1 year ago

You are on a very old version of twine. The latest version, 4.0.2, is in fact compatible with this version of urllib3

bhrutledge commented 1 year ago

There's a detailed discussion of this in https://github.com/pypa/twine/issues/989

reswqa commented 1 year ago

I see. Thanks for the quick reply and thanks for sharing the context with me. 👍