Message405182
json.tool is very cute and handy for making json readable.
But rewriting a file in place requires tools like sponge (on POSIX) or a tmpfile, because
$ python -m json.tool foo.json foo.json
results in an empty foo.json.
I propose soaking up the infile before opening the outfile for writing, to prevent that. Much like sort -o does, but without the explicit flag.
The patch I have prepared changes no behaviours, other than preventing an empty file... (still I see this as an enhancement and not a bug fix) |
|
Date |
User |
Action |
Args |
2021-10-28 12:59:07 | CharString | set | recipients:
+ CharString |
2021-10-28 12:59:07 | CharString | set | messageid: <1635425947.02.0.769956758277.issue45644@roundup.psfhosted.org> |
2021-10-28 12:59:07 | CharString | link | issue45644 messages |
2021-10-28 12:59:06 | CharString | create | |
|