Skip to content

Commit 13f5f6c

Browse files
committed
Parse data.json with json.load() in explicit_encoding.py
Keeps data.json handling consistent with app_v1.py and app_v2.py across the tutorial's examples. legacy.csv stays a raw read, since the point there is the locale sentinel rather than parsing.
1 parent 9d15c05 commit 13f5f6c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import json
2+
13
with open("data.json", encoding="utf-8") as f: # Portable and unambiguous
2-
data = f.read()
4+
data = json.load(f)
35

46
with open("legacy.csv", encoding="locale") as f: # Intentional locale use
57
legacy = f.read()

0 commit comments

Comments
 (0)