diff -r 69080ee1fb0e -r ddeb7653b31c mercurial/ui.py --- a/mercurial/ui.py Mon Feb 12 10:41:00 2018 -0500 +++ b/mercurial/ui.py Wed Feb 14 16:37:46 2018 +0530 @@ -808,8 +808,8 @@ hint=_("use 'hg config --edit' " 'to set your username')) if "\n" in user: - raise error.Abort(_("username %s contains a newline\n") - % repr(user)) + raise error.Abort(_("username %r contains a newline\n") + % pycompat.bytestr(user)) return user def shortuser(self, user):