py3: make tests/test-log-linerange.t work on Python 3
Made sure we write bytes to file and we suppress the return value of open().
Differential Revision: https://phab.mercurial-scm.org/D2893
To run the tests, do:
cd tests/
python run-tests.py
See https://mercurial-scm.org/wiki/WritingTests for
more information on writing tests.