From f552749de613981a408d9b1a34e67b0f53f4f1ae Mon Sep 17 00:00:00 2001 From: holger krekel Date: Tue, 18 May 2010 21:25:20 +0200 Subject: [PATCH] a crucial close() to prevent too-many-open-files --HG-- branch : trunk --- py/_io/capture.py | 1 + 1 file changed, 1 insertion(+) diff --git a/py/_io/capture.py b/py/_io/capture.py index b091ab3d2..b2decd60f 100644 --- a/py/_io/capture.py +++ b/py/_io/capture.py @@ -58,6 +58,7 @@ class FDCapture: if self.targetfd == 0 and not self.tmpfile: fd = os.open(devnullpath, os.O_RDONLY) os.dup2(fd, 0) + os.close(fd) if hasattr(self, '_oldsys'): setattr(sys, patchsysdict[self.targetfd], DontReadFromInput()) else: