Skip to content

Commit 0ec88b3

Browse files
committed
Fixed #1578: Problems in win_getpass
1 parent 2f1019e commit 0ec88b3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Lib/getpass.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ def win_getpass(prompt='Password: ', stream=None):
4949
return default_getpass(prompt, stream)
5050
import msvcrt
5151
for c in prompt:
52-
msvcrt.putch(c)
52+
msvcrt.putwch(c)
5353
pw = ""
5454
while 1:
55-
c = msvcrt.getch()
55+
c = msvcrt.getwch()
5656
if c == '\r' or c == '\n':
5757
break
5858
if c == '\003':
@@ -61,8 +61,8 @@ def win_getpass(prompt='Password: ', stream=None):
6161
pw = pw[:-1]
6262
else:
6363
pw = pw + c
64-
msvcrt.putch('\r')
65-
msvcrt.putch('\n')
64+
msvcrt.putwch('\r')
65+
msvcrt.putwch('\n')
6666
return pw
6767

6868

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Extension Modules
2525
Library
2626
-------
2727

28+
- Issue #1578: Problems in win_getpass
29+
2830

2931
What's New in Python 3.0a2?
3032
===========================

0 commit comments

Comments
 (0)