py3: byteify the LFS blobstore module
This is almost entirely b'' prefixing, with a couple of exceptions forced to
bytes. Much of this is also borrowed from Augie's code. There's an
HTTPError.read() that I flagged that I assume needs to be converted to bytes,
but I can't find confirmation.
Handling the deserialized JSON object over several functions made r'' vs b''
accesses confusing, so this assumes that the JSON object will be converted to
bytes immediately. That will be done in the following commits, so it's not
buried in these trivial changes.
py3: raw stringify various things in the LFS server module
Some of this is based on code written by Augie. I'm slightly unsure if these
are the correct pycompat bytes <-> str conversion methods.
py3: add b'' prefixes to the LFS server module
There are a ton of these changes in the blobstore, as well as r'' prefixing. So
separating these out hopefully makes review easier.
# skip-blame for b'' prefixing
py3: more tests from the ratchet
Differential Revision: https://phab.mercurial-scm.org/D5730
dispatch: unify handler of IOError and OSError
These exceptions were merged in Python 3.
dispatch: quote filename in IOError as well
It's explicitly added for OSError at
720308f741cb "dispatch: show empty
filename in OSError aborts". Let's do the same for IOError.
dispatch: add inline comment about possible IOError subtypes
It's hard to tell which "if" would handle which exception.
convert: print exception message directly
Otherwise the default repr() implementation will b'' prefix the
returned str on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5729
crecord: always return a str from uihunk.__repr__
Otherwise Python 3 complains about it returning bytes.
Differential Revision: https://phab.mercurial-scm.org/D5728