# HG changeset patch # User Gregory Szorc # Date 2019-11-02 20:08:20 # Node ID 5fa8ac91190e1f5ae879497323710184273abc0d # Parent e6ce1599af74467a38065c9640d16be1a1ff3309 fsmonitor: coerce watchman exception to bytes Without this, we get errors due to passing str to a function which expects bytes. Differential Revision: https://phab.mercurial-scm.org/D7206 diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py --- a/hgext/fsmonitor/__init__.py +++ b/hgext/fsmonitor/__init__.py @@ -214,9 +214,17 @@ def _handleunavailable(ui, state, ex): state.invalidate() # experimental config: fsmonitor.verbose if ui.configbool(b'fsmonitor', b'verbose'): - ui.log(b'fsmonitor', b'Watchman unavailable: %s\n', ex.msg) + ui.log( + b'fsmonitor', + b'Watchman unavailable: %s\n', + stringutil.forcebytestr(ex.msg), + ) else: - ui.log(b'fsmonitor', b'Watchman exception: %s\n', ex) + ui.log( + b'fsmonitor', + b'Watchman exception: %s\n', + stringutil.forcebytestr(ex), + ) def _hashignore(ignore):