changeset 46079:e614eeb794f9 stable

ui: remove excessive strtolocal() from debuguigetpass ui.getpass() returns Optional[bytes], and strtolocal(bytes) would crash. Follows up 07b0a687c01a "ui: ensure `getpass()` returns bytes."
author Yuya Nishihara <yuya@tcha.org>
date Thu, 03 Dec 2020 18:42:23 +0900
parents dadbd01f9393
children 1d252e73af61
files mercurial/debugcommands.py
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)