diff -r 4db5671d57d9 -r 330c258fe7ca mercurial/ui.py --- a/mercurial/ui.py Sat Oct 17 21:57:21 2020 +0900 +++ b/mercurial/ui.py Thu Oct 29 00:17:12 2020 -0700 @@ -1661,7 +1661,9 @@ if not r: r = default if self.configbool(b'ui', b'promptecho'): - self._writemsg(self._fmsgout, r, b"\n", type=b'promptecho') + self._writemsg( + self._fmsgout, r or b'', b"\n", type=b'promptecho' + ) return r except EOFError: raise error.ResponseExpected()