Consolidate file IO error handling and add function names to PyArg_Parse calls