[issue45644] Make json.tool soak up input before opening output for writing

2022-01-18 Thread Inada Naoki
Change by Inada Naoki : -- nosy: +methane nosy_count: 4.0 -> 5.0 pull_requests: +28860 pull_request: https://github.com/python/cpython/pull/30659 ___ Python tracker ___

[issue45644] Make json.tool soak up input before opening output for writing

2021-11-08 Thread Chris Wesseling
Change by Chris Wesseling : -- pull_requests: +27729 pull_request: https://github.com/python/cpython/pull/29478 ___ Python tracker ___

[issue45644] Make json.tool soak up input before opening output for writing

2021-11-08 Thread Chris Wesseling
Chris Wesseling added the comment: @Remi I left the current behaviour for --json-lines untouched, on purpose. My reasoning was that the json-lines format is often seen in JSON streaming, and I didn't want to break the case where the input is an endless stream from stdin or a named pipe. And

[issue45644] Make json.tool soak up input before opening output for writing

2021-11-07 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: The proposed path does not work for `python -m json.tool --json-lines test.json test.json`. There is also https://github.com/python/cpython/pull/7865 that aims to fix this bug but I did not have the time to get back to it. -- nosy: +remi.lapeyre

[issue45644] Make json.tool soak up input before opening output for writing

2021-11-06 Thread Łukasz Langa
Łukasz Langa added the comment: Thanks, Chris! ✨  ✨ -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue45644] Make json.tool soak up input before opening output for writing

2021-11-06 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset a932631890d148444e5f9b09f4b57305475d6386 by Miss Islington (bot) in branch '3.9': bpo-45644: Make json.tool read infile before writing to outfile (GH-29273) (GH-29446)

[issue45644] Make json.tool soak up input before opening output for writing

2021-11-06 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 6603f6b5bdf0ed164bad4eb432619da2e95fb518 by Miss Islington (bot) in branch '3.10': bpo-45644: Make json.tool read infile before writing to outfile (GH-29273) (GH-29445)

[issue45644] Make json.tool soak up input before opening output for writing

2021-11-06 Thread miss-islington
Change by miss-islington : -- pull_requests: +27700 pull_request: https://github.com/python/cpython/pull/29446 ___ Python tracker ___

[issue45644] Make json.tool soak up input before opening output for writing

2021-11-06 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 815dad42d53fc40a6dc057e067f4a8a885c3b858 by Chris Wesseling in branch 'main': bpo-45644: Make json.tool read infile before writing to outfile (GH-29273) https://github.com/python/cpython/commit/815dad42d53fc40a6dc057e067f4a8a885c3b858

[issue45644] Make json.tool soak up input before opening output for writing

2021-11-06 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +27699 pull_request: https://github.com/python/cpython/pull/29445 ___ Python tracker

[issue45644] Make json.tool soak up input before opening output for writing

2021-11-06 Thread Łukasz Langa
Łukasz Langa added the comment: This is arguably a bugfix since truncating the `infile` cannot be construed as a useful feature in any sense. Thus I'm inclined to backport this to 3.10.1 and 3.9.9 too. -- nosy: +lukasz.langa type: enhancement -> behavior versions: +Python 3.10,

[issue45644] Make json.tool soak up input before opening output for writing

2021-10-28 Thread Chris Wesseling
Change by Chris Wesseling : -- pull_requests: +27537 pull_request: https://github.com/python/cpython/pull/29273 ___ Python tracker ___

[issue45644] Make json.tool soak up input before opening output for writing

2021-10-28 Thread Chris Wesseling
Change by Chris Wesseling : -- keywords: +patch pull_requests: +27532 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29269 ___ Python tracker ___

[issue45644] Make json.tool soak up input before opening output for writing

2021-10-28 Thread Chris Wesseling
New submission from Chris Wesseling : 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