file() no longer exists in Python 3. The current version does not explicitly close file handles but this version fixes that.