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.

Author matanya.stroh
Recipients matanya.stroh
Date 2018-02-22.00:22:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1519258965.74.0.467229070634.issue32884@psf.upfronthosting.co.za>
In-reply-to
Content
for getpass.win_getpass() it can simply be done by adding this line
msvcrt.putch("*").
So the code will look like:

def win_getpass(prompt='Password: ', stream=None):
    """Prompt for password with echo off, using Windows getch()."""
    if sys.stdin is not sys.__stdin__:
        return fallback_getpass(prompt, stream)

    for c in prompt:
        msvcrt.putwch(c)
    pw = ""
    while 1:
        c = msvcrt.getwch()
        if c == '\r' or c == '\n':
            break
        if c == '\003':
            raise KeyboardInterrupt
        if c == '\b':
            pw = pw[:-1]
        else:
            pw = pw + c
            msvcrt.putch("*") #Line that was added
    msvcrt.putwch('\r')
    msvcrt.putwch('\n')
    return pw
History
Date User Action Args
2018-02-22 00:22:45matanya.strohsetrecipients: + matanya.stroh
2018-02-22 00:22:45matanya.strohsetmessageid: <1519258965.74.0.467229070634.issue32884@psf.upfronthosting.co.za>
2018-02-22 00:22:45matanya.strohlinkissue32884 messages
2018-02-22 00:22:45matanya.strohcreate