Fix file mode for python unit tests.