fsmonitor: coerce watchman exception to bytes stable
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 02 Nov 2019 13:08:20 -0700
branchstable
changeset 43390 5fa8ac91190e
parent 43389 e6ce1599af74
child 43391 ffdf0bf28212
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
hgext/fsmonitor/__init__.py
--- a/hgext/fsmonitor/__init__.py	Sat Nov 02 13:04:47 2019 -0700
+++ b/hgext/fsmonitor/__init__.py	Sat Nov 02 13:08:20 2019 -0700
@@ -214,9 +214,17 @@
             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):