diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2006-12-22 18:41:42 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2006-12-22 18:41:42 (GMT) |
commit | ee0e6d16b371a66e1d9ab8103fb51117db37cdbc (patch) | |
tree | 566bc24fe583c883252b956a9f6fe10b1602e0eb /Lib/pty.py | |
parent | 3fa5e6ee4527219a9351413ac6ba425be8ea5dd8 (diff) | |
download | cpython-ee0e6d16b371a66e1d9ab8103fb51117db37cdbc.zip cpython-ee0e6d16b371a66e1d9ab8103fb51117db37cdbc.tar.gz cpython-ee0e6d16b371a66e1d9ab8103fb51117db37cdbc.tar.bz2 |
[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.
Diffstat (limited to 'Lib/pty.py')
-rw-r--r-- | Lib/pty.py | 4 |
1 files changed, 3 insertions, 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 |