Problem trying to upload to pypi using twine, but not using hatch

27 views Asked by At

I'm trying to upload a new version of a package but I got an error such

urllib3.exceptions.LocationParseError: Failed to parse: https://upload.pypi.org/legacy/

I have uploaded other versions from the same package, but if I try:

$ twine  upload --verbose  dist/syncmodels-0.1.2-py2.py3-none-any.whl 

I got

Uploading distributions to https://upload.pypi.org/legacy/
INFO     dist/syncmodels-0.1.2-py2.py3-none-any.whl (22.3 KB)                                                                            
INFO     username set by command options                                                                                                 
INFO     password set by command options                                                                                                 
INFO     username: __token__                                                                                                             
INFO     password: <hidden>                                                                                                              
Uploading syncmodels-0.1.2-py2.py3-none-any.whl
  0% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/28.3 kB • --:-- • ?
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/models.py", line 382, in prepare_url
    scheme, auth, host, port, path, query, fragment = parse_url(url)
  File "/usr/lib/python3/dist-packages/urllib3/util/url.py", line 394, in parse_url
    return six.raise_from(LocationParseError(source_url), None)
  File "<string>", line 2, in raise_from
urllib3.exceptions.LocationParseError: Failed to parse: https://upload.pypi.org/legacy/

I am using the last available version 4.0.2 from pypi

$ twine --version
twine version 4.0.2 (importlib-metadata: 4.6.4, keyring: 23.5.0, pkginfo: 1.9.6, requests: 2.25.1, requests-toolbelt: 1.0.0, urllib3:
1.26.5)

In the other hand, using hatch with same credentials works fine.

$ hatch publish
Enter your username [__token__]: 
Enter your credentials: 
dist/syncmodels-0.1.2-py2.py3-none-any.whl ... success

[syncmodels]
https://pypi.org/project/syncmodels/0.1.2/

So it looks like there is a problem with the content provided by https://upload.pypi.org/legacy/

Anyone have had the same experience with twine?

Thanks in advance

0

There are 0 answers