Error: Upload failed (401) (regression)

Create issue
Issue #250 resolved
Jason R. Coombs created an issue

Sometime between 0.6.21 and the code tagged as 0.6.23, the upload command no longer works. I have a .pypirc with a username and password for pypi, but when I attempt an upload, I get the following error:

{{{ Upload failed (401): You must be identified to edit package information }}}

If I roll back to 0.6.21, the upload completes as expected. Note also that 0.6.22 was never tagged.

Comments (8)

  1. Tarek Ziadé repo owner

    Yes that's why I reverted the release.

    Thos are changes made by Guy. He needs to fix this before we can release a clean 0.6.24

  2. Guy Rozendorn

    Jason, can you please attach your .pypi file to this ticket (after deleting the password)? Its working for me. My .pypirc file looks like this:

    [distutils]
    index-servers =
        pypi
        local
    
    [local]
    repository: <some index server in our intranet>
    username: pypi
    password: <password>
    
    [pypi]
    repository: http://www.python.org/pypi
    username: guyr
    password: <password>
    
    

    Thanks, Guy

  3. Jason R. Coombs reporter

    Mine looks like this:

    [server-login]
    username=jason.coombs
    password=*omitted*
    
    [distutils]
    index-servers =
        pypi
        contoso
    
    [pypi]
    username: jaraco
    password: *omitted*
    
    [contoso]
    repository: https://cheese.contoso.com
    username: jason.coombs
    password: *omitted*
    

    My guess, based on the changelog, is that the lack of a repository for [pypi] is the cause. Since older versions supported a .pypirc without the repository (and defaulted to http://pypi.python.org/pypi), I would think distutils 0.6 should always support that format. At there very least, there should be interim releases that output warnings about an upcoming requirement for the repository setting, and a better error message should be output when the setting is eventually required and isn't present.

    What's the reason the repository should be specified in each .pypirc? It seems like the pypi is an excellent default if the repository isn't specified.

  4. Guy Rozendorn

    The reason I thought that each section must have its own repository is that in case you had a typo in the "repository" keyword, your package would've been uploaded by mistake to pypi.python.org.

    But I'm reading again http://docs.python.org/distutils/packageindex.html and thats what is intended. so I will revert the two changes of issues 244 and 244 (or whatever the term is in mercurial).

  5. Guy Rozendorn

    It looks like pypi.python.org is down, I'll check that the revert works later and push the change. then we can release 0.6.24

  6. Guy Rozendorn

    pypi is now online, and I checked that register/upload works without having to explicitly define a repository in .pypirc.

    Jason, please verify (head is now 77db8a2dd2d0).

    Thanks and sorry for the mess.

  7. Log in to comment