Use file objects instead of filenames