-
-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-33927: Add support for same infile and outfile to json.tool #7865
bpo-33927: Add support for same infile and outfile to json.tool #7865
Conversation
5bac29f
to
e18835f
Compare
e18835f
to
04b2ade
Compare
This doesn't look like the right solution to me. You may need to skip the |
Hi @rhettinger, thanks for the comments.
I'm not sure to follow, if I understand Pablo's remark in https://bugs.python.org/issue33927#msg320326 the problem is about the leaked fd When this happens, the second fd has been open by Both leaks shown by Pablo seems to be fixed by this patch:
Am I missing something? |
Looks good to me!
|
The CI failed due to a timeout... |
23593fb
to
04b2ade
Compare
Indeed, I ran it again and all is good now. |
Consider to reference these changes in a new entry to the Misc. |
LGTM! Thanks for your contrib! |
Hi @rhettinger , I think |
106f4bc
to
ed871c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Rémi,
Thank you for your contribution but I think you need to improve your PR.
Have a nice day,
Thank you
Can you please fix the file conflicts? |
…me-infile-outfile
Hi @rhettinger, I resolved the conflix. One thing I changed is that |
@rhettinger, the resolved the conflicts with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is PR #11992 which is similar but looks simpler.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Oh sorry, these two PR have a different purpose. |
Thoughts? |
I like -i option of the sed command: "sed -i file" modify file in-place, "sed file" writes the output into stdout.
I prefer to explicitly ask to modify the file in-place, rather than using black magic to try to support this uncommon case. If -i/--in-place is used, you can read the full content in memory. I disagree with changing the behavior (always load full data in memory) by default. |
Hi @vstinner, I made the changes requested to read |
I don't have the bandwidth to review it. @matrixise @4383: Would you mind to review it. @remilapeyre: Once someone will approve the PR, I will have a new look if you want ;-) |
@vstinner @remilapeyre Tomorrow I can review it and send my feed back. |
…me-infile-outfile
@remilapeyre Do you want to finish this PR, I could continue the review with you. Have a nice day. |
Misc/NEWS.d/next/Library/2018-06-27-14-46-03.bpo-33927.felCrI.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
I close this because #29273 is merged. |
https://bugs.python.org/issue33927