def foo(file_path): with open(file_path, encoding="utf-8") as file: contents = file.read()