mirror of
https://github.com/python/cpython.git
synced 2025-09-16 13:47:31 +00:00
[Patch #783050 from Patrick Lynch] The emulation of forkpty() is incorrect;
the master should close the slave fd. Added a test to test_pty.py that reads from the master_fd after doing a pty.fork(); without the fix it hangs forever instead of raising an exception. (<crossing fingers for the buildbots>) 2.5 backport candidate.
This commit is contained in:
parent
3fa5e6ee45
commit
ee0e6d16b3
2 changed files with 18 additions and 1 deletions
|
@ -121,7 +121,9 @@ def fork():
|
|||
# Explicitly open the tty to make it become a controlling tty.
|
||||
tmp_fd = os.open(os.ttyname(STDOUT_FILENO), os.O_RDWR)
|
||||
os.close(tmp_fd)
|
||||
|
||||
else:
|
||||
os.close(slave_fd)
|
||||
|
||||
# Parent and child process.
|
||||
return pid, master_fd
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue