Skip to content

Commit 6caeb3e

Browse files
gaschetimabbott
authored andcommitted
fix a typing error: json.load(p, encoding='utf-8') takes no encoding
According to the 'json' documentation, json.load never took an encoding parameter, json.loads (load string) had one until 3.9. I guess that recently the checks for irrelevant parameters got stricter, this causes a failure on my Python 3.9 setup: ``` TypeError: __init__() got an unexpected keyword argument 'encoding' ``` fixes #50
1 parent 525c5fd commit 6caeb3e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def read_zulip_stream_info(json_root):
7373
to other files deeper in the directory structure.
7474
"""
7575
f = (json_root / Path("stream_index.json")).open("r", encoding="utf-8")
76-
stream_info = json.load(f, encoding="utf-8")
76+
stream_info = json.load(f)
7777
f.close()
7878
return stream_info
7979

lib/populate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def populate_incremental(
196196
exit_immediately(error_msg)
197197

198198
f = stream_index.open("r", encoding="utf-8")
199-
js = json.load(f, encoding="utf-8")
199+
js = json.load(f)
200200
f.close()
201201

202202
for s in (s for s in streams if is_valid_stream_name(s["name"])):

0 commit comments

Comments
 (0)