Switching from file object to io.FileIO