Patchwork D7190: py3: fix fsmonitor's _watchmantofsencoding exception message encoding

login
register
mail settings
Submitter phabricator
Date Nov. 1, 2019, 4:42 p.m.
Message ID <differential-rev-PHID-DREV-lpwnikxsdohg6fhchfat-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42655/
State Superseded
Headers show

Comments

phabricator - Nov. 1, 2019, 4:42 p.m.
touilleMan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/fsmonitor/__init__.py

CHANGE DETAILS




To: touilleMan, #hg-reviewers
Cc: 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
@@ -246,12 +246,12 @@ 
     try:
         decoded = path.decode(_watchmanencoding)
     except UnicodeDecodeError as e:
-        raise error.Abort(str(e), hint=b'watchman encoding error')
+        raise error.Abort(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(forcebytestr(e))
 
     return encoded