fix setup.py for python3

The builtin funciont `file` does not exist in python 3.4. Replace it with `with open`.