( )⚙ D7187 py3: fix fsmonitor error message formatting under Python3

This is an archive of the discontinued Mercurial Phabricator instance.

py3: fix fsmonitor error message formatting under Python3
Needs RevisionPublic

Authored by touilleMan on Nov 1 2019, 12:14 PM.

Details

Reviewers
indygreg
Group Reviewers
hg-reviewers
Summary

The watchmanclient.Unavailable exception got an invalid str
method resulting in a crash when watchman is not available.
This fix also solve tests/test-install.t.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

touilleMan created this revision.Nov 1 2019, 12:14 PM
touilleMan updated this revision to Diff 17435.Nov 1 2019, 12:16 PM
indygreg requested changes to this revision.Nov 1 2019, 1:22 PM
indygreg added a subscriber: indygreg.
indygreg added inline comments.
hgext/fsmonitor/watchmanclient.py
25

There's no __bytes__ on Python 2. So we'll want to preserve an implementation for Python 2.

This is typically something like __str__ = encoding.strmethod(__bytes__)

This revision now requires changes to proceed.Nov 1 2019, 1:22 PM