Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to enter token on package upload. #1177

Closed
1 task done
ekohilas opened this issue Nov 14, 2024 · 1 comment
Closed
1 task done

Unable to enter token on package upload. #1177

ekohilas opened this issue Nov 14, 2024 · 1 comment
Labels

Comments

@ekohilas
Copy link

Is there an existing issue for this?

  • I have searched the existing issues (open and closed), and could not find an existing issue

What keywords did you use to search existing issues?

token
upload
password

What operating system are you using?

Linux

If you selected 'Other', describe your Operating System here

No response

What version of Python are you running?

Python 3.12.0

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

python3 -m pip install --upgrade twine

What version of twine do you have installed (include the complete output)

python3 -m twine --version
twine version 5.1.1 (importlib-metadata: 8.5.0, keyring: 25.5.0, pkginfo: 1.10.0, requests: 2.31.0,
requests-toolbelt: 1.0.0, urllib3: 2.0.6)

Which package repository are you using?

test.pypi.org

Please describe the issue that you are experiencing

Following the guide here: https://packaging.python.org/tutorials/packaging-projects

The guide says to type in token and enter the api key as the password, however:

  1. typing in token doesn't appear on the command line
  2. the password is not asked for
  3. a 403 is returned, regardless if entering __token__ or the pypi token blindly.

Erroneous output

$ python3 -m twine upload --repository testpypi dist/* --verbose
Uploading distributions to https://test.pypi.org/legacy/
INFO     dist/example_package_ekohilas-0.0.1-py3-none-any.whl (2.7 KB)                              
INFO     dist/example_package_ekohilas-0.0.1.tar.gz (2.1 KB)                                        
INFO     Querying keyring for password                                                              
Enter your API token: 
INFO     username: __token__                                                                        
INFO     password: <hidden>                                                                         
Uploading example_package_ekohilas-0.0.1-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.2/6.2 kB • 00:00 • ?
INFO     Response from https://test.pypi.org/legacy/:                                               
         403 Forbidden                                                                              
INFO     <html>                                                                                     
          <head>                                                                                    
           <title>403 Invalid or non-existent authentication information. See                       
         https://test.pypi.org/help/#invalid-auth for more information.</title>                     
          </head>                                                                                   
          <body>                                                                                    
           <h1>403 Invalid or non-existent authentication information. See                          
         https://test.pypi.org/help/#invalid-auth for more information.</h1>                        
           Access was denied to this resource.<br/><br/>                                            
         Invalid or non-existent authentication information. See                                    
         https://test.pypi.org/help/#invalid-auth for more information.                             
                                                                                                    
                                                                                                    
          </body>                                                                                   
         </html>                                                                                    
ERROR    HTTPError: 403 Forbidden from https://test.pypi.org/legacy/                                
         Forbidden

However uploads work fine when using .pypirc

Please list the steps required to reproduce this behaviour

python3 -m twine upload --repository testpypi dist/*

Anything else you'd like to mention?

pypa/packaging-problems#841

@sigmavirus24
Copy link
Member

Replied in the original issue. This isn't a bug in twine

@sigmavirus24 sigmavirus24 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants