Title: upload command fails to read auth information from .pypirc
Type: Stage:
Components: Distutils Versions: Python 3.2
Status: open Resolution:
Dependencies: Superseder:
Assigned To: tarek Nosy List: catherine, catherinedevlin, eric.araujo, freakboy3742, jaraco, tarek
Priority: normal Keywords:

Created on 2011-03-11 22:27 by jaraco, last changed 2011-09-23 14:50 by freakboy3742.

Messages (5)
msg130633 - (view) Author: Jason R. Coombs (jaraco) * (Python committer) Date: 2011-03-11 22:27
It appears that distutils isn't loading the authentication information from .pypirc. I ran this test on Python 3.2 64-bit on Windows.

PS C:\Users\jaraco\projects\hgtools> python -m pdb sdist upload
> c:\users\jaraco\projects\hgtools\<module>()
-> """
(Pdb) b distutils/command/
Breakpoint 1 at c:\python\lib\distutils\command\
(Pdb) c
running sdist
running egg_info
# lines elided
Writing hgtools-1.0b1\setup.cfg
creating 'dist\' and adding 'hgtools-1.0b1' to it
adding 'hgtools-1.0b1\.hgignore'
# lines elided
removing 'hgtools-1.0b1' (and everything under it)
running upload
Submitting dist\ to
> c:\python\lib\distutils\command\
-> loglevel = log.INFO
(Pdb) auth
'Basic Og=='
(Pdb) user_pass
(Pdb) c
Upload failed (401): You must be identified to edit package information
The program finished and will be restarted
> c:\users\jaraco\projects\hgtools\<module>()

I have a valid .pypirc that works in Python 2.7:

C:\Users\jaraco\projects\hgtools> cat C:\Users\jaraco\.pypirc

index-servers =

username: jaraco
password: omitted

I tried adding repository= in [pypi], or supplying -r, but that had no effect.

I tried adding -r pypi, but that elicited a new error.
msg141323 - (view) Author: Catherine Devlin (catherine) Date: 2011-07-29 00:02
This blog post

describes working around the same problem by replacing [pypi] in .pypirc with [server-login].  Is that the problem, a change in .pypirc formats?
msg141324 - (view) Author: Jason R. Coombs (jaraco) * (Python committer) Date: 2011-07-29 00:32
I don't believe that's the issue. The [server-login] is for Python 2.5 and earlier. Also note that I already had [server-login] in the .pypirc when the error occurred, so I don't think that's a factor either.

This same .pypirc works just fine on Python 2.5, 2.6, and 2.7, so I believe the regression is somewhere in the Python 3 line.
msg141362 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-07-29 12:43
Can you set DISTUTILS_DEBUG in your environment, retry to run the command and post the output?
msg144446 - (view) Author: Russell Keith-Magee (freakboy3742) * Date: 2011-09-23 14:50
This isn't just a Python 3 issue -- I'm seeing this with the default Python install on OS X Snow Leopard (i.e. Python 2.6.1). Changing the .pypirc config line to [server-login] fixed the problem for me, too.
Date User Action Args
2011-09-23 14:50:33freakboy3742setnosy: + freakboy3742
messages: + msg144446
2011-07-29 12:43:56eric.araujosetmessages: + msg141362
2011-07-29 00:32:08jaracosetmessages: + msg141324
2011-07-29 00:02:44catherinesetnosy: + catherinedevlin, catherine
messages: + msg141323
2011-03-11 22:27:09jaracocreate