Patchwork D11708: fsmonitor: fix traceback about bytes and str incompatibility

login
register
mail settings
Submitter phabricator
Date Oct. 20, 2021, 8:27 a.m.
Message ID <differential-rev-PHID-DREV-3bxhy6gv2of6nbvisbqy-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50032/
State Superseded
Headers show

Comments

phabricator - Oct. 20, 2021, 8:27 a.m.
Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This didn't work anymore in Python 3, switching to a `repr` based reporting does

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/fsmonitor/__init__.py

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: mercurial-patches, 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
@@ -564,8 +564,8 @@ 
             for i, (s1, s2) in enumerate(zip(l1, l2)):
                 if set(s1) != set(s2):
                     f.write(b'sets at position %d are unequal\n' % i)
-                    f.write(b'watchman returned: %s\n' % s1)
-                    f.write(b'stat returned: %s\n' % s2)
+                    f.write(b'watchman returned: %r\n' % s1)
+                    f.write(b'stat returned: %r\n' % s2)
         finally:
             f.close()