This is an archive of the discontinued Mercurial Phabricator instance.

fsmonitor: coerce `clock` variable to byte-string (issue6321)
ClosedPublic

Authored by sheehan on May 20 2020, 11:28 AM.

Details

Summary

Callers of fsmonitor.state.setlastclock pass their arguments
wrapped in pycompat.sysbytes to ensure the value is a bytes
on Python 3. However in fsmonitor.poststatus.__call__, if the
return value of getlastclock() is None, we use the value of
fsmonitor.poststatus._startclock instead, which is not converted
to a byte string in the same manner. This commit converts the
value of startclock to a byte string using pycompat.sysbytes
in the constructor for poststatus, to avoid the "str + bytes"
error from issue 6321.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

sheehan created this revision.May 20 2020, 11:28 AM
indygreg accepted this revision.May 20 2020, 8:05 PM
indygreg added a subscriber: indygreg.

I'm going to queue this for stable, as it is a Python 3 compatibility issue affecting a distinguished Australian end-user :p

This revision is now accepted and ready to land.May 20 2020, 8:05 PM