]> granicus.if.org Git - python/commitdiff
Merge 70717 to 30maint
authorJesse Noller <jnoller@gmail.com>
Mon, 30 Mar 2009 16:37:36 +0000 (16:37 +0000)
committerJesse Noller <jnoller@gmail.com>
Mon, 30 Mar 2009 16:37:36 +0000 (16:37 +0000)
Lib/multiprocessing/connection.py
Lib/test/test_multiprocessing.py
Misc/NEWS

index 1c4d48e5cf23d12dad18ac7175cf98948c8bb39e..5e94fedfb8d559cbed4e0813f9e81e54a26f4d31 100644 (file)
@@ -214,6 +214,7 @@ class SocketListener(object):
     '''
     def __init__(self, address, family, backlog=1):
         self._socket = socket.socket(getattr(socket, family))
+        self._socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
         self._socket.bind(address)
         self._socket.listen(backlog)
         self._address = self._socket.getsockname()
index 0f91c97c606cf6138c40cf2b9b88571b3bd86d0b..33f3bf306e5c3084943ac09b094ffac81c24a6fa 100644 (file)
@@ -1190,6 +1190,30 @@ class _TestRemoteManager(BaseTestCase):
         del queue
         manager.shutdown()
 
+class _TestManagerRestart(BaseTestCase):
+
+    def _putter(self, address, authkey):
+        manager = QueueManager(
+            address=address, authkey=authkey, serializer=SERIALIZER)
+        manager.connect()
+        queue = manager.get_queue()
+        queue.put('hello world')
+
+    def test_rapid_restart(self):
+        authkey = os.urandom(32)
+        manager = QueueManager(
+            address=('localhost', 9999), authkey=authkey, serializer=SERIALIZER)
+        manager.start()
+
+        p = self.Process(target=self._putter, args=(manager.address, authkey))
+        p.start()
+        queue = manager.get_queue()
+        self.assertEqual(queue.get(), 'hello world')
+        manager.shutdown()
+        manager = QueueManager(
+            address=('localhost', 9999), authkey=authkey, serializer=SERIALIZER)
+        manager.start()
+
 #
 #
 #
index 96d5eae3b35426e08987c450d2eeac5c6aff4f16..82c44aa351a37d5f79a00e6b979e8027769476d8 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -255,6 +255,36 @@ Core and Builtins
 Library
 -------
 
+- Issue #5177: Multiprocessing's SocketListener class now uses 
+  socket.SO_REUSEADDR on all connections so that the user no longer needs
+  to wait 120 seconds for the socket to expire.
+
+- Adjusted _tkinter to compile without warnings when WITH_THREAD is not
+  defined (part of issue #5035).
+
+- Issue #5561: Removed the sys.version_info shortcuts from platform's
+  python_version() and python_version_tuple() since they produced different
+  output compared to previous Python versions.
+
+- Issue #1034053: unittest now supports skipping tests and expected failures.
+
+- Issue #5068: Fixed the tarfile._BZ2Proxy.read() method that would loop
+  forever on incomplete input. That caused tarfile.open() to hang when used
+  with mode 'r' or 'r:bz2' and a fileobj argument that contained no data or
+  partial bzip2 compressed data.
+
+- Issue #5536: urllib.urlretrieve makes sure to close the file it's writing to
+  even if an exception occurs.
+
+- Issue #5381: Added object_pairs_hook to the json module.  This allows
+  OrderedDicts to be built by the decoder.
+
+- Issue #2110: Add support for thousands separator and 'n' type
+  specifier to Decimal.__format__
+
+- Fix Decimal.__format__ bug that swapped the meanings of the '<' and
+  '>' alignment characters.
+
 - Issue #1222: locale.format() bug when the thousands separator is a space
   character.