[Python-Dev] Proposal for the getpass module (original) (raw)

Guido van Rossum guido at python.org
Sun Feb 7 01:30:55 CET 2010


[redirecting to python-ideas]

On Sat, Feb 6, 2010 at 4:08 PM, Tarek Ziadé <ziade.tarek at gmail.com> wrote:

Hello,

I would like to propose a small change in the getpass module so it's able to get passwords from keyrings (like KWallet, Keychain, etc) The idea is to provide a getpass.cfg configuration file where people can provide the name of a function to use when getpass is called. Then third-party projects can implement this function. For example the Python Keyring library.[1] could be installed and configured to be used by people that wants getpass calls to be handled by this tool. That's a backward compatible change, and it avoids adding any new module in the stdlib. Plus, it offers a greatly improved getpass module with no risks for the stdlib stability : it becomes a reference implementation with an interface for third-party implementers. A prototype is here : http://bitbucket.org/tarek/getpass/ (work in progress but you can get the idea) [1] http://pypi.python.org/pypi/keyring

Don't you usually have to tell the keyring which password to retrieve? The signature for getpass() doesn't have enough info for that.

I'm not sure that not adding a new module to the stdlib is a sufficient reason to foist the new semantics on an old function.

-- --Guido van Rossum (python.org/~guido)



More information about the Python-Dev mailing list