bpo-26228: pty.spawn hangs on FreeBSD, OS X, and Solaris#4167
bpo-26228: pty.spawn hangs on FreeBSD, OS X, and Solaris#4167diekmann wants to merge 7 commits intopython:mainfrom
Conversation
There was a problem hiding this comment.
Missing module again. In PR #2932 you fixed this line. See https://bugs.python.org/review/29070/diff/19699/Lib/pty.py#newcode170.
There was a problem hiding this comment.
Thanks for catching this ... again 🎃 👻
Thank you so much for your feedback! 🥇
vadmium
left a comment
There was a problem hiding this comment.
I can’t see anything seriously wrong with 005dc23, although I think it would be better to test the API (pty.spawn), without depending on the internals (_copy, select, etc) if possible.
There was a problem hiding this comment.
Why is the method called stdin_stdout, while the body only looks at STDIN_FILENO?
There was a problem hiding this comment.
Fixed in the following commit: A docstring explains the name and the method also checks for STDOUT_FILENO.
There was a problem hiding this comment.
I suspect the raise statement never executes because TestCase.fail raises its own exception.
There was a problem hiding this comment.
Your suspicion is appropriate. Fixed in the following commit.
There was a problem hiding this comment.
What is the point of this test? I don’t think it matters.
You seem to be modelling a situation where input (or EOF) to the child becomes available at about the same instant that the slave terminal is closed. If _copy were written differently, it might copy the input to the child (STDIN_FILENO) before checking the pseudoterminal master (master_fd), and the test would fail.
There was a problem hiding this comment.
True, this part of the test is overly fitted for an unnecessary implementation detail. Removed in the following commit
|
Yes, blackbox tests for the API (pty.spawn) would be nice. But at the moment, they could not be merged in isolation because they would fail on FreeBSD.
|
* Linux -> Unix * More details about the behavior of spawn
Thanks to vadmium for catching this error twice. https://bugs.python.org/review/29070/diff/19699/Lib/pty.py#newcode170
|
Closing in favor of GH-12049. |
Co-authored-by: Cornelius Diekmann <[email protected]>
|
The doc part of this was included in GH-27754. |
…ythonGH-27754) Co-authored-by: Cornelius Diekmann <[email protected]> (cherry picked from commit dd8eb30) Co-authored-by: Łukasz Langa <[email protected]>
Co-authored-by: Cornelius Diekmann <[email protected]>
Co-authored-by: Cornelius Diekmann <[email protected]> (cherry picked from commit dd8eb30) Co-authored-by: Łukasz Langa <[email protected]>
issue26228 as github PR.
This PR contains:
According to the bpo discussion, this fixes
pty.spawn()on FreeBSD, OS X, and Solaris.https://bugs.python.org/issue26228