]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-45644: Make json.tool read infile before writing to outfile (GH-29273) (GH-29445)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 6 Nov 2021 18:01:17 +0000 (11:01 -0700)
committerGitHub <noreply@github.com>
Sat, 6 Nov 2021 18:01:17 +0000 (19:01 +0100)
commit6603f6b5bdf0ed164bad4eb432619da2e95fb518
tree5235ee34b728843a4f24a1673e5194d023f18765
parent804ea41211b042fa20c3cd8c0457bbfa3873128a
bpo-45644:  Make json.tool read infile before writing to outfile (GH-29273) (GH-29445)

so that

$ python -m json.tool foo.json foo.json

doesn't result in an empty foo.json.

Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
(cherry picked from commit 815dad42d53fc40a6dc057e067f4a8a885c3b858)

Co-authored-by: Chris Wesseling <chris.wesseling@protonmail.com>
Lib/json/tool.py
Lib/test/test_json/test_tool.py
Misc/NEWS.d/next/Library/2021-11-06-17-47-46.bpo-45644.ZMqHD_.rst [new file with mode: 0644]