py3: decode prompt string before calling rawinput
Calling input() (aka pycompat.rawinput() on python3) with a byte string
displays a byte string in the console. E.g. in interactive commit, we
get: b"examine changes to '<file>'?\n(enter ? for help) [Ynesfdaq?]".
Similarly, "hg email" prompts are messed up.
We thus decode the prompt string before running rawinput().
--- a/mercurial/ui.py Tue Oct 08 15:06:18 2019 -0700
+++ b/mercurial/ui.py Wed Oct 09 15:28:16 2019 +0200
@@ -1555,6 +1555,7 @@
# - http://bugs.python.org/issue12833
with self.timeblockedsection(b'stdio'):
if usereadline:
+ prompt = encoding.strfromlocal(prompt)
line = encoding.strtolocal(pycompat.rawinput(prompt))
# When stdin is in binary mode on Windows, it can cause
# raw_input() to emit an extra trailing carriage return