ui: remove excessive strtolocal() from debuguigetpass stable
authorYuya Nishihara <yuya@tcha.org>
Thu, 03 Dec 2020 18:42:23 +0900
branchstable
changeset 46079 e614eeb794f9
parent 46029 dadbd01f9393
child 46080 1d252e73af61
ui: remove excessive strtolocal() from debuguigetpass ui.getpass() returns Optional[bytes], and strtolocal(bytes) would crash. Follows up 07b0a687c01a "ui: ensure `getpass()` returns bytes."
mercurial/debugcommands.py
--- a/mercurial/debugcommands.py	Thu Dec 03 13:36:24 2020 -0500
+++ b/mercurial/debugcommands.py	Thu Dec 03 18:42:23 2020 +0900
@@ -3787,9 +3787,7 @@
 def debuguigetpass(ui, prompt=b''):
     """show prompt to type password"""
     r = ui.getpass(prompt)
-    if r is not None:
-        r = encoding.strtolocal(r)
-    else:
+    if r is None:
         r = b"<default response>"
     ui.writenoi18n(b'response: %s\n' % r)