Skip to content

Commit e04f47c

Browse files
committed
Fix 'I/O operation on closed file' when parsing JSON Lines file
1 parent e42bda9 commit e04f47c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/json/tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def main():
5555
infile = open(options.infile, encoding='utf-8')
5656
try:
5757
if options.json_lines:
58-
objs = (json.loads(line) for line in infile)
58+
objs = tuple(json.loads(line) for line in infile)
5959
else:
6060
objs = (json.load(infile),)
6161
finally:

0 commit comments

Comments
 (0)