Patchwork D7206: fsmonitor: coerce watchman exception to bytes

login
register
mail settings
Submitter phabricator
Date Nov. 2, 2019, 10:04 p.m.
Message ID <differential-rev-PHID-DREV-w2b3ip2sy6mupjllvbgc-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42689/
State Superseded
Headers show

Comments

phabricator - Nov. 2, 2019, 10:04 p.m.
indygreg created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Without this, we get errors due to passing str to a function
  which expects bytes.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D7206

AFFECTED FILES
  hgext/fsmonitor/__init__.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mjpieters, mercurial-devel

Patch

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 @@ 
             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):