Re: [PATCH STABLE] ui: remove excessive strtolocal() from debuguigetpass

2020-12-04 Thread Augie Fackler
queued for stable, thanks

> On Dec 3, 2020, at 05:06, Yuya Nishihara  wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1606988543 -32400
> #  Thu Dec 03 18:42:23 2020 +0900
> # Branch stable
> # Node ID 074a20823c4be85d4b98a76c2ba961ff640cc80e
> # Parent  27c23c8f14da48a24a0896b588721c0139e92560
> 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)
> 
> 
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH STABLE] ui: remove excessive strtolocal() from debuguigetpass

2020-12-03 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1606988543 -32400
#  Thu Dec 03 18:42:23 2020 +0900
# Branch stable
# Node ID 074a20823c4be85d4b98a76c2ba961ff640cc80e
# Parent  27c23c8f14da48a24a0896b588721c0139e92560
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)
 

___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel