py3: replace file() with open() in test-encoding.t...
py3: replace file() with open() in test-encoding.t
file() is not present in Python 3.
This also makes sure we write things in bytes mode in Python 3.
Differential Revision:
https://phab.mercurial-scm.org/D2130