From: Andrew M. Kuchling Date: Sat, 5 Jun 2004 16:27:16 +0000 (+0000) Subject: [Bug #897935] Fix fd leak in pty.spawn(). Reported by James Henstridge; 2.3 bugfix... X-Git-Tag: v2.4a1~259 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a2c9a98a0a43a7a0bd8d4d35a03f486acb92453e;p=thirdparty%2FPython%2Fcpython.git [Bug #897935] Fix fd leak in pty.spawn(). Reported by James Henstridge; 2.3 bugfix candidate. --- diff --git a/Lib/pty.py b/Lib/pty.py index a70a865dc361..cafbc9c962d1 100644 --- a/Lib/pty.py +++ b/Lib/pty.py @@ -175,3 +175,5 @@ def spawn(argv, master_read=_read, stdin_read=_read): except (IOError, OSError): if restore: tty.tcsetattr(STDIN_FILENO, tty.TCSAFLUSH, mode) + + os.close(master_fd)