# HG changeset patch # User Gregory Szorc # Date 1518407023 28800 # Node ID 976a9fd706ed8e5d990d324476d492f53b126d61 # Parent 8eb13f5d5d3f294b82b5e05821c275d81f8059a8 py3: convert traceback representation to bytes when logging Python's APIs should return a system string. We want to use bytes for logging. So convert the traceback to bytes before sending it to the logger. Differential Revision: https://phab.mercurial-scm.org/D2176 diff -r 8eb13f5d5d3f -r 976a9fd706ed mercurial/dispatch.py --- a/mercurial/dispatch.py Sun Feb 11 19:26:53 2018 -0800 +++ b/mercurial/dispatch.py Sun Feb 11 19:43:43 2018 -0800 @@ -992,6 +992,7 @@ this function returns False, ignored otherwise. """ warning = _exceptionwarning(ui) - ui.log("commandexception", "%s\n%s\n", warning, traceback.format_exc()) + ui.log("commandexception", "%s\n%s\n", warning, + pycompat.sysbytes(traceback.format_exc())) ui.warn(warning) return False # re-raise the exception