Mercurial > kallithea
changeset 6044:3b1ef6d95d62
hooks: always convert unicode to byte strings when passed to ui.status
Kallithea generally uses unicode strings internally, but ui.status follows the
Mercurial convention and expects a byte string. Strings passed to ui.status
should thus always by converted to byte strings. Do that explicitly with
safe_str. (The alternative of using more byte strings internally seems less
appealing.)
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Thu, 28 Jul 2016 16:28:34 +0200 |
parents | 5a38b9084a9e |
children | 9ec73e01e5b1 |
files | kallithea/lib/hooks.py |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/lib/hooks.py Wed Jun 15 18:33:27 2016 +0200 +++ b/kallithea/lib/hooks.py Thu Jul 28 16:28:34 2016 +0200 @@ -99,7 +99,7 @@ _http_ret = HTTPLockedRC(ex.repository, locked_by) if str(_http_ret.code).startswith('2'): #2xx Codes don't raise exceptions - ui.status(_http_ret.title) + ui.status(safe_str(_http_ret.title)) else: raise _http_ret @@ -114,7 +114,7 @@ _http_ret = HTTPLockedRC(ex.repository, locked_by) if str(_http_ret.code).startswith('2'): #2xx Codes don't raise exceptions - ui.status(_http_ret.title) + ui.status(safe_str(_http_ret.title)) else: raise _http_ret @@ -149,7 +149,7 @@ _http_ret = HTTPLockedRC(ex.repository, locked_by) if str(_http_ret.code).startswith('2'): #2xx Codes don't raise exceptions - ui.status(_http_ret.title) + ui.status(safe_str(_http_ret.title)) return 0 @@ -204,7 +204,7 @@ _http_ret = HTTPLockedRC(ex.repository, locked_by) if str(_http_ret.code).startswith('2'): #2xx Codes don't raise exceptions - ui.status(_http_ret.title) + ui.status(safe_str(_http_ret.title)) return 0