diff mercurial/windows.py @ 47859:155a2ec8a9dc

merge with stable
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 22 Aug 2021 16:32:06 -0400
parents 064cd182555f
children 4162f6b40f2c
line wrap: on
line diff
--- a/mercurial/windows.py	Tue Jul 20 17:20:19 2021 +0200
+++ b/mercurial/windows.py	Sun Aug 22 16:32:06 2021 -0400
@@ -200,20 +200,20 @@
     This shouldn't be called directly- use ``ui.getpass()`` instead, which
     checks if the session is interactive first.
     """
-    pw = ""
+    pw = u""
     while True:
         c = msvcrt.getwch()  # pytype: disable=module-attr
-        if c == '\r' or c == '\n':
+        if c == u'\r' or c == u'\n':
             break
-        if c == '\003':
+        if c == u'\003':
             raise KeyboardInterrupt
-        if c == '\b':
+        if c == u'\b':
             pw = pw[:-1]
         else:
             pw = pw + c
-    msvcrt.putwch('\r')  # pytype: disable=module-attr
-    msvcrt.putwch('\n')  # pytype: disable=module-attr
-    return encoding.strtolocal(pw)
+    msvcrt.putwch(u'\r')  # pytype: disable=module-attr
+    msvcrt.putwch(u'\n')  # pytype: disable=module-attr
+    return encoding.unitolocal(pw)
 
 
 class winstdout(object):