Otherwise we will call str.encode() on Python 2, which is wrong.
sysbytes() does encode('utf-8) on Python 3. But the source is
guaranteed ASCII, so it shouldn't matter.
With this change, hg now runs with HGUNICODEPEDANTRY=1 set.
However, several tests are failing.