This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: make the storage of the password optional in .pypirc (using the prompt)
Type: enhancement Stage:
Components: Distutils Versions: Python 3.1, Python 2.7
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: tarek Nosy List: loewis, tarek
Priority: normal Keywords: patch

Created on 2008-11-23 14:58 by tarek, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
no_password.patch tarek, 2008-11-23 14:58
Messages (9)
msg76268 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2008-11-23 14:58
Right now you HAVE to store a clear text password in .pypirc.

But this should not be necessary since the "register" command does a
getpass.getpass call to get the password from the prompt and use it to
authenticate to pypi.

So what do we miss ? 

We miss a bit of persistency for the upload command to get that password
when register + upload have been called in the same command line, typically:

$ python setup.py register sdist upload

this patch does it, and adds a test for it.

I am wondering though if upload wouldn't be better not to depend on a 
previous call to register (basically by adding a getpass.getpass call
there too), but this can be a second patch.
msg76269 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-11-23 17:51
According to my tests, something is hosed with password saving in the
register command for 3.0 already: the saved password doesn't seem to be
used. Before this patch is considered, the other problem should be
resolved (but isn't yet reported to roundup, AFAICT).
msg76281 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2008-11-23 23:44
can you provide me a scenario to reproduce it ? 

-> did you have a .pypirc already with no password, or no .pypirc, etc..
msg76284 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-11-24 00:09
Here is what I did:
1. I started with no pypirc
2. I ran register, it asked me for username, password
3. I chose to save it, it created a .pypirc
4. I ran register again, it asked me again for username, password, even
though this was saved already.

Looking at the code, it seems the problem is that the pypirc has a
section pypirc that lists the server, but the code reading it wants a
section distutils.
msg76285 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2008-11-24 00:39
I could reproduce it under 2.6, 

the problem is located at distutils.config.DEFAULT_PYPIRC

the default structure is wrong there, I'll add a ticket with a patch
and a test right away
msg76287 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2008-11-24 00:55
Ok, I wrote a patch for the problem you mentioned in 

http://bugs.python.org/issue4400
msg79049 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-01-04 12:01
I have fixed issue4400, and I am back at work for this feature. 

I will propose it in Distutils-SIG to see what people think.
msg79428 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-01-08 18:20
Ok, I had one +1 from distutils-SIG, so I am updating this patch to
commit it in 2.7 and 3.1.
msg79450 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-01-09 00:20
done in r68415
History
Date User Action Args
2022-04-11 14:56:41adminsetgithub: 48644
2009-01-09 00:20:07tareksetstatus: open -> closed
messages: + msg79450
2009-01-08 18:20:38tareksetmessages: + msg79428
versions: - Python 3.0
2009-01-04 12:01:23tareksetassignee: tarek
messages: + msg79049
2008-11-24 00:55:41tareksetmessages: + msg76287
2008-11-24 00:39:04tareksetmessages: + msg76285
2008-11-24 00:09:15loewissetmessages: + msg76284
2008-11-23 23:44:45tareksetmessages: + msg76281
2008-11-23 17:51:04loewissetnosy: + loewis
messages: + msg76269
2008-11-23 14:58:30tarekcreate