# HG changeset patch # User Yuya Nishihara # Date 2020-12-03 09:42:23 # Node ID e614eeb794f9d5473200e028e55f95e977b00f0b # Parent dadbd01f939379a2eea76eab313868fcde48138a ui: remove excessive strtolocal() from debuguigetpass ui.getpass() returns Optional[bytes], and strtolocal(bytes) would crash. Follows up 07b0a687c01a "ui: ensure `getpass()` returns bytes." diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -3787,9 +3787,7 @@ def debugtemplate(ui, repo, tmpl, **opts 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"" ui.writenoi18n(b'response: %s\n' % r)