py3: fix fsmonitor's _watchmantofsencoding exception message encoding
Differential Revision: https://phab.mercurial-scm.org/D7190
--- a/hgext/fsmonitor/__init__.py Thu Oct 31 15:03:12 2019 -0700
+++ b/hgext/fsmonitor/__init__.py Fri Nov 01 11:02:47 2019 -0700
@@ -246,12 +246,14 @@
try:
decoded = path.decode(_watchmanencoding)
except UnicodeDecodeError as e:
- raise error.Abort(str(e), hint=b'watchman encoding error')
+ raise error.Abort(
+ stringutil.forcebytestr(e), hint=b'watchman encoding error'
+ )
try:
encoded = decoded.encode(_fsencoding, 'strict')
except UnicodeEncodeError as e:
- raise error.Abort(str(e))
+ raise error.Abort(stringutil.forcebytestr(e))
return encoded