py3: replace file() with open() in test-import.t
file() is not present in Python 3.
This patch also adds a b'' prefix to make sure we write bytes in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2123
#require docutils gettext $ $TESTDIR/check-gendoc da checking for parse errors