]> granicus.if.org Git - python/commitdiff
Patch #838546: Make terminal become controlling in pty.fork().
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 9 Nov 2006 11:06:03 +0000 (11:06 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 9 Nov 2006 11:06:03 +0000 (11:06 +0000)
Will backport to 2.5.

Lib/pty.py
Misc/NEWS

index fae162dc487509c909db8b477dc6fa93f443c8d0..889113c3dd57b975b493b7ee02323687edac38cf 100644 (file)
@@ -118,6 +118,10 @@ def fork():
         if (slave_fd > STDERR_FILENO):
             os.close (slave_fd)
 
+        # 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)
+
     # Parent and child process.
     return pid, master_fd
 
index 3409c8dd71c1789bf1d64192ce1d1b34e180b86e..9f6d782e24061fa6ff143e75f6ee5b2d8bc563f8 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -96,6 +96,8 @@ Core and builtins
 Library
 -------
 
+- Patch #838546: Make terminal become controlling in pty.fork()
+
 - Patch #1351744: Add askyesnocancel helper for tkMessageBox.
 
 - Patch #1060577: Extract list of RPM files from spec file in