fix file reading in python 3

This would enable the package to be used from Python 3 (and thus enable me to port pudo/dataset).