-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Explicitly close read and write of Popen process (latex) #3309
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
Conversation
@pwuertz Any thoughts on this? |
I guess I thought |
Out of interest: Does that warning depend on closing |
You are right that the documentation is not clear. I think that you only need to close the stdin and stdout when you explicitly read/write to them. If you only use communicate the buffers are auto closed. The warnings only relate to read buffers so closing stdout should be sufficient. |
Does the animation module suffer the same problem?
|
You are right that there is a potential one in the framesink used in the non file based writer. This is the only place where popen stdout/in is used in the animation module. There is another one in the file based one which is already closed explicitly. |
Any objections to merging this. Apart from the issues fixed by #3291 these are the last warning that I see in the test suite on the master branch. |
No real objection, if it works, but the whole block looks odd: first because it doesn't seem right to close the pipes before calling |
Perhaps its best to remove wait() and close stdout after communicate() then. |
032070d
to
e699189
Compare
Rebased, I will clean this up later. |
This avoids a warning in the test suite on python3.4. When reading and writing from directly from stdout and stdin of the process they should be explicitly closed afterwards.
307d8fb
to
4fd757b
Compare
Finally got round change this to implement the suggestions above. I think this should be ready to review. |
👍 |
MNT : Explicitly close read and write of Popen process (latex)
This suppresses the final unclosed buffer/file warning in the test suite on python3.4 inside the
pgf backend.
When reading and writing from directly from stdout and stdin of the popen process they
should be explicitly closed afterwards.
These are similar to the ones fixed in #3235