[issue33927] Allow json.tool to have identical infile and outfile

2021-11-08 Thread Chris Wesseling
Change by Chris Wesseling : -- nosy: +CharString nosy_count: 6.0 -> 7.0 pull_requests: +27728 pull_request: https://github.com/python/cpython/pull/29478 ___ Python tracker ___

[issue33927] Allow json.tool to have identical infile and outfile

2021-05-05 Thread Stéphane Wirtel
Change by Stéphane Wirtel : -- versions: +Python 3.11 -Python 3.10 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue33927] Allow json.tool to have identical infile and outfile

2021-04-12 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Hello @pablogsal, What do you think about the PR of Rémi? Thank you, -- versions: -Python 3.7, Python 3.8, Python 3.9 ___ Python tracker

[issue33927] Allow json.tool to have identical infile and outfile

2020-06-20 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- components: +Library (Lib) versions: +Python 3.10, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker ___

[issue33927] Allow json.tool to have identical infile and outfile

2019-02-22 Thread hervé
Change by hervé : -- pull_requests: +12015 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33927] Allow json.tool to have identical infile and outfile

2018-06-29 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi Pablo, I added two tests to confirm that file descriptors do not link anymore. The tests are rather ugly but I'm not sure if it's possible to do better. Is this patch ok for you? -- ___ Python tracker

[issue33927] Allow json.tool to have identical infile and outfile

2018-06-24 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi Pablo, while this patch should fix both problems, I'm not sure how to write a regression test for this, `assert_python_ok` in https://github.com/python/cpython/pull/7865/files#diff-7d4645839a05727ebdf39226fd56e29cR97 forks the interpreter so I'm not sure I

[issue33927] Allow json.tool to have identical infile and outfile

2018-06-23 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Maybe we should include a test that checks that if you provide an invalid file the file descriptors are not leaked (it can be in a different PR, maybe). -- ___ Python tracker

[issue33927] Allow json.tool to have identical infile and outfile

2018-06-23 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: @Rémi can you include a NEWS entry? Also, indicate that your patch prevents a file descriptor to be leaked in the cases indicated in my last message. -- ___ Python tracker

[issue33927] Allow json.tool to have identical infile and outfile

2018-06-23 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: The current status of json.tool also leaks a file descriptor if you use the same filename or an invalid one (needs debug build to receive this error message): $ ./python -m json.tool invalid_file.dat nofile.dat Expecting value: line 1 column 1 (char

[issue33927] Allow json.tool to have identical infile and outfile

2018-06-23 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi, I proposed a path in https://github.com/python/cpython/pull/7865, I'm not sure if I can apply the label `skip news` or if only a reviewer can. -- ___ Python tracker

[issue33927] Allow json.tool to have identical infile and outfile

2018-06-22 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch pull_requests: +7474 stage: -> patch review ___ Python tracker ___ ___

[issue33927] Allow json.tool to have identical infile and outfile

2018-06-22 Thread Ned Deily
Change by Ned Deily : -- nosy: +ezio.melotti, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33927] Allow json.tool to have identical infile and outfile

2018-06-21 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi Michael, looking at the current code of json.tool, there is no reason for it not to be able to do this, I will a patch to do this tonight. -- nosy: +remi.lapeyre ___ Python tracker

[issue33927] Allow json.tool to have identical infile and outfile

2018-06-21 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: yep, or you could use sponge cat example.json | python3 -m json.tool | sponge example.json a small workaround ;-) -- nosy: +matrixise ___ Python tracker

[issue33927] Allow json.tool to have identical infile and outfile

2018-06-21 Thread Michael Kuhlmann
New submission from Michael Kuhlmann : It would be nice to have same infile and outfile for json.tool to replace json files with their pretty-printed version. Currently, if I try this I get an error: $ python3 -m json.tool example.json example.json Expecting value: line 1 column 1 (char 0)