Fixed io tests on Python 3