]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-77065: Use `putwch` instead of `putch` in `getpass.win_getpass` (#134058)
authorSemyon Moroz <donbarbos@proton.me>
Thu, 15 May 2025 15:14:31 +0000 (15:14 +0000)
committerGitHub <noreply@github.com>
Thu, 15 May 2025 15:14:31 +0000 (15:14 +0000)
Lib/getpass.py

index a4dbd2ea6502d425ddbe745982b0406340a06e75..1dd40e25e0906888dc1e72790b5b62d910eb0ad6 100644 (file)
@@ -119,9 +119,9 @@ def win_getpass(prompt='Password: ', stream=None, *, echo_char=None):
             raise KeyboardInterrupt
         if c == '\b':
             if echo_char and pw:
-                msvcrt.putch('\b')
-                msvcrt.putch(' ')
-                msvcrt.putch('\b')
+                msvcrt.putwch('\b')
+                msvcrt.putwch(' ')
+                msvcrt.putwch('\b')
             pw = pw[:-1]
         else:
             pw = pw + c