with open("file.txt", "r", encoding="utf-8") as f: ...