| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| :func:`subprocess.communicate` no longer raises an IndexError when there is an | ||
| empty stdout or stderr IO buffer during a timeout on Windows. |
| Back | FazBrowse Home | New Git URL |
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThere's an additional bug exposed by the above fix. This line could now return ([], []) instead of (None, None).
Changing the above translation logic to
would work. call this option [A[.
though nicer code all around would be to not use _stdXXX_buff = [] at all but instead refactor _readerthread to take an attribute name to assign to instead of passing it a list to shove a single element in.
something similar to:
def _readerthread(self, fh, attr_name): try: setattr(self, attr_name, fh.read()) finally: fh.close()that larger refactoring makes sense in the context of 3.10. call this option [B].
as a bugfix for 3.9 and earlier i'd stick with the modification of the stdout and stderr assignments. The time when this case even happens looks to be only when the timeout has expired on the joins() above. So what's broken is timeout logic on Windows during a timeout when collecting stdout and stderr.
lets go ahead with [A] in this PR and a followup PR can do [B].
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityUpdated to option A
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityIf either thread is still alive, then a TimeoutExpired will be raised. The only time there is a problem is if one or more reader threads has failed, either by being forcibly terminated via TerminateThread (not exposed to Python code, except via ctypes) or if the fh.read() call fails, which is most likely due to another thread calling CancelSynchronousIo (also only exposed to Python code via ctypes).
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.