Skip to content

Commit

Permalink
Fixed #1578: Problems in win_getpass
Browse files Browse the repository at this point in the history
  • Loading branch information
tiran committed Dec 10, 2007
1 parent 2f1019e commit 0ec88b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Lib/getpass.py
Expand Up @@ -49,10 +49,10 @@ def win_getpass(prompt='Password: ', stream=None):
return default_getpass(prompt, stream)
import msvcrt
for c in prompt:
msvcrt.putch(c)
msvcrt.putwch(c)
pw = ""
while 1:
c = msvcrt.getch()
c = msvcrt.getwch()
if c == '\r' or c == '\n':
break
if c == '\003':
Expand All @@ -61,8 +61,8 @@ def win_getpass(prompt='Password: ', stream=None):
pw = pw[:-1]
else:
pw = pw + c
msvcrt.putch('\r')
msvcrt.putch('\n')
msvcrt.putwch('\r')
msvcrt.putwch('\n')
return pw


Expand Down
2 changes: 2 additions & 0 deletions Misc/NEWS
Expand Up @@ -25,6 +25,8 @@ Extension Modules
Library
-------

- Issue #1578: Problems in win_getpass


What's New in Python 3.0a2?
===========================
Expand Down

0 comments on commit 0ec88b3

Please sign in to comment.