Use "open" instead of "file".

"file" is not supported in Python 3.
Merge pull request #23 from tomwys/patch-1

Use "open" instead of "file".