From: Antoine Pitrou Date: Tue, 23 Aug 2011 17:48:34 +0000 (+0200) Subject: Issue #11657: Fix sending file descriptors over 255 over a multiprocessing Pipe. X-Git-Tag: v3.3.0a1~1629^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=162fee109b4469b8b2aec063f6225e19e83ae208;p=thirdparty%2FPython%2Fcpython.git Issue #11657: Fix sending file descriptors over 255 over a multiprocessing Pipe. Also added some tests. --- 162fee109b4469b8b2aec063f6225e19e83ae208 diff --cc Lib/test/test_multiprocessing.py index 405fbd525693,6f1c6c44977a..7a7805d59f68 --- a/Lib/test/test_multiprocessing.py +++ b/Lib/test/test_multiprocessing.py @@@ -71,24 -76,12 +76,29 @@@ HAVE_GETVALUE = not getattr(_multiproce 'HAVE_BROKEN_SEM_GETVALUE', False) WIN32 = (sys.platform == "win32") +if WIN32: + from _subprocess import WaitForSingleObject, INFINITE, WAIT_OBJECT_0 + + def wait_for_handle(handle, timeout): + if timeout is None or timeout < 0.0: + timeout = INFINITE + else: + timeout = int(1000 * timeout) + return WaitForSingleObject(handle, timeout) == WAIT_OBJECT_0 +else: + from select import select + _select = util._eintr_retry(select) + + def wait_for_handle(handle, timeout): + if timeout is not None and timeout < 0.0: + timeout = None + return handle in _select([handle], [], [], timeout)[0] + try: + MAXFD = os.sysconf("SC_OPEN_MAX") + except: + MAXFD = 256 + # # Some tests require ctypes # diff --cc Misc/NEWS index b2d9e84b943b,fca436c6fe35..4b5a9a6d7783 --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -268,32 -76,6 +268,35 @@@ Core and Builtin Library ------- ++- Issue #11657: Fix sending file descriptors over 255 over a multiprocessing ++ Pipe. ++ +- Issue #12811: tabnanny.check() now promptly closes checked files. Patch by + Anthony Briggs. + +- Issue #6560: The sendmsg/recvmsg API is now exposed by the socket module + when provided by the underlying platform, supporting processing of + ancillary data in pure Python code. Patch by David Watson and Heiko Wundram. + +- Issue #12326: On Linux, sys.platform doesn't contain the major version + anymore. It is now always 'linux', instead of 'linux2' or 'linux3' depending + on the Linux version used to build Python. + +- Issue #12213: Fix a buffering bug with interleaved reads and writes that + could appear on BufferedRandom streams. + +- Issue #12778: Reduce memory consumption when JSON-encoding a large + container of many small objects. + +- Issue #12650: Fix a race condition where a subprocess.Popen could leak + resources (FD/zombie) when killed at the wrong time. + +- Issue #12744: Fix inefficient representation of integers between 2**31 and + 2**63 on systems with a 64-bit C "long". + +- Issue #12646: Add an 'eof' attribute to zlib.Decompress, to make it easier to + detect truncated input streams. + - Issue #11513: Fix exception handling ``tarfile.TarFile.gzopen()`` when the file cannot be opened.