io.StringIO has no attribute 'reset'.