From: Antoine Pitrou Date: Tue, 10 May 2011 17:19:13 +0000 (+0200) Subject: Issue #8498: In socket.accept(), allow to specify 0 as a backlog value in X-Git-Tag: v3.3.0a1~2320 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3cade9942e5e3cc6d185ee5c1b444498e297be02;p=python Issue #8498: In socket.accept(), allow to specify 0 as a backlog value in order to accept exactly one connection. Patch by Daniel Evers. --- 3cade9942e5e3cc6d185ee5c1b444498e297be02 diff --cc Lib/test/test_socket.py index c811ec445c,4100c34452..3efe1bbc0c --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@@ -791,12 -788,13 +791,19 @@@ class GeneralModuleTests(unittest.TestC fp.close() self.assertEqual(repr(fp), "<_io.BufferedReader name=-1>") - def testListenBacklog0(self): + def test_pickle(self): + sock = socket.socket() + with sock: + for protocol in range(pickle.HIGHEST_PROTOCOL + 1): + self.assertRaises(TypeError, pickle.dumps, sock, protocol) + ++ def test_listen_backlog0(self): + srv = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + srv.bind((HOST, 0)) + # backlog = 0 + srv.listen(0) + srv.close() + @unittest.skipUnless(thread, 'Threading required for this test.') class BasicTCPTest(SocketConnectedTest): diff --cc Misc/ACKS index 297dccac17,399de8cba9..36778ff2db --- a/Misc/ACKS +++ b/Misc/ACKS @@@ -270,7 -268,7 +270,8 @@@ Carey Evan Tim Everett Paul Everitt David Everly + Daniel Evers +Winston Ewert Greg Ewing Martijn Faassen Clovis Fabricio diff --cc Misc/NEWS index 2b0529e789,ac9ac79da2..6b9da84672 --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -143,29 -86,11 +143,32 @@@ Core and Builtin Library ------- + - Issue #8498: In socket.accept(), allow to specify 0 as a backlog value in + order to accept exactly one connection. Patch by Daniel Evers. + +- Issue #12011: signal.signal() and signal.siginterrupt() raise an OSError, + instead of a RuntimeError: OSError has an errno attribute. + +- Issue #3709: a flush_headers method to BaseHTTPRequestHandler which manages + the sending of headers to output stream and flushing the internal headers + buffer. Patch contribution by Andrew Schaaf + +- Issue #11743: Rewrite multiprocessing connection classes in pure Python. + - Issue #11164: Stop trying to use _xmlplus in the xml module. +- Issue #11888: Add log2 function to math module. Patch written by Mark + Dickinson. + +- Issue #12012: ssl.PROTOCOL_SSLv2 becomes optional. + +- Issue #8407: The signal handler writes the signal number as a single byte + instead of a nul byte into the wakeup file descriptor. So it is possible to + wait more than one signal and know which signals were raised. + +- Issue #8407: Add pthread_kill(), sigpending() and sigwait() functions to the + signal module. + - Issue #11927: SMTP_SSL now uses port 465 by default as documented. Patch by Kasun Herath.