This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author fpmc
Recipients d_kagedal, fpmc, gregory.p.smith, mkc, yorick
Date 2009-03-31.08:13:15
SpamBayes Score 1.2767565e-14
Marked as misclassified No
Message-id <1238487205.11.0.334113422728.issue3392@psf.upfronthosting.co.za>
In-reply-to
Content
Hi,

This is a patch that uses poll() in subprocess.communicate() if it is
available.  This is my first patch and may contain style errors.  I try
to conform to PEP 8 as close as I can.

Besides the discussion here, I would like to add this is desired because
select() has its own limit on the file descriptor size, in FD_SETSIZE. 
Unix has a different limit on the largest file descriptor, in 'ulimit
-n'.  When the select() limit is smaller than the ulimit limit, it is
not hard to get a file descriptor that is beyond FD_SETSIZE.  In that
case select() simply does not work.  Since there is no precise way to
force file descriptor to be small, the only workaround seems to be hack
like what hte first poster yorick suggests.

This is tested via 'python regrtest.py -w test_subprocess' under a
system that supports poll().  I don't have a system that does *not*
support poll, but I've done some manual edits to force that code path
and test it as well.  The test passes, which I think should be good
enough as it has several tests on communicate().

This patch is against 2.6.
History
Date User Action Args
2009-03-31 08:13:28fpmcsetrecipients: + fpmc, gregory.p.smith, mkc, yorick, d_kagedal
2009-03-31 08:13:25fpmcsetmessageid: <1238487205.11.0.334113422728.issue3392@psf.upfronthosting.co.za>
2009-03-31 08:13:18fpmclinkissue3392 messages
2009-03-31 08:13:16fpmccreate