Fix failing test in python3

file type is gone, instead we have to use io.IOBase.
Tests now passing in python2 and python3.