[Python-ideas] Password masking for getpass.getpass
Steven D'Aprano
steve at pearwood.info
Tue Jan 12 20:54:14 EST 2016
On Tue, Jan 12, 2016 at 07:11:55PM -0600, Muhammad Ahmed Khalid wrote:
> Greetings,
>
> I am working on a project and I am using getpass.getpass() to grab
> passwords from the user.
>
> Some of the users wanted asterisks to be displayed when they were typing in
> the passwords for feedback i.e. how many characters were typed and how many
> to backspace.
I think that's an excellent idea.
The old convention on Linux and Unix is to just suppress all feedback,
but even on Linux GUI applications normally show bullets • or asterisks.
Users who are less familiar with old-school Unix conventions have
trouble with the standard password idiom of suppressing all feedback.
> Therefore I have created a solution but I think the feature should come by
> default (and the programmer should have the option to use a blank or any
> other character).
I think that the default should remain as it is now, but I would support
adding an extra argument for getpass() to set the feedback character.
But it would need to support POSIX systems (Unix, Linux and Mac OS X) as
well as Windows.
--
Steve
More information about the Python-ideas
mailing list