]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-77065: Use `putwch` instead of `putch` in `getpass.win_getpass` (GH-134058...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 15 May 2025 15:41:37 +0000 (17:41 +0200)
committerGitHub <noreply@github.com>
Thu, 15 May 2025 15:41:37 +0000 (15:41 +0000)
gh-77065: Use `putwch` instead of `putch` in `getpass.win_getpass` (GH-134058)
(cherry picked from commit 52a7a22a6b85a470e993b3399b0ee043e5c3596e)

Co-authored-by: Semyon Moroz <donbarbos@proton.me>
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