--- buggy.py +++ fixed.py @@ -6,7 +6,7 @@ def read_orders(path): - with open(path, encoding="utf-8", newline="") as source: + with open(path, encoding="utf-8-sig", newline="") as source: return [ {"order_id": row["order_id"], "note": row["note"]} for row in csv.DictReader(source)