Use open() instead of file()

From the [documentation](https://docs.python.org/release/2.7/library/functions.html#file):

>When opening a file, it’s preferable to use open() instead of invoking this constructor directly. file is more suited to type testing (for example, writing isinstance(f, file)).