py3: port f to Python 3
This involved a lot of b'' literals, conversion from %s to %d, and
using a hashing mechanism that returns bytes instead of str.
Differential Revision: https://phab.mercurial-scm.org/D2299
public attributes not in abstract interface: badpeer.badattributepublic attributes not in abstract interface: badpeer.badmethod