# HG changeset patch -- Bitbucket.org
# Project py-trunk
# URL http://bitbucket.org/hpk42/py-trunk/overview
# User holger krekel <hol...@merlinux.eu>
# Date 1274210720 -7200
# Node ID 1940650af8d4761e9b36bb49bc99b57064fc2941
# Parent  10c5b10df1d4fce68554092457178273bb1b2d98
a crucial close() to prevent too-many-open-files

--- 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:
_______________________________________________
py-svn mailing list
py-svn@codespeak.net
http://codespeak.net/mailman/listinfo/py-svn

Reply via email to