[Python-checkins] r68839 - in python/trunk/Lib: multiprocessing/managers.py test/test_multiprocessing.py

jesse.noller python-checkins at python.org
Wed Jan 21 03:08:17 CET 2009


Author: jesse.noller
Date: Wed Jan 21 03:08:17 2009
New Revision: 68839

Log:
Issue 5009: multiprocessing: failure in manager._debug_info()

Modified:
   python/trunk/Lib/multiprocessing/managers.py
   python/trunk/Lib/test/test_multiprocessing.py

Modified: python/trunk/Lib/multiprocessing/managers.py
==============================================================================
--- python/trunk/Lib/multiprocessing/managers.py	(original)
+++ python/trunk/Lib/multiprocessing/managers.py	Wed Jan 21 03:08:17 2009
@@ -136,7 +136,7 @@
         self.listener = Listener(address=address, backlog=5)
         self.address = self.listener.address
 
-        self.id_to_obj = {0: (None, ())}
+        self.id_to_obj = {'0': (None, ())}
         self.id_to_refcount = {}
         self.mutex = threading.RLock()
         self.stop = 0
@@ -298,7 +298,7 @@
             keys = self.id_to_obj.keys()
             keys.sort()
             for ident in keys:
-                if ident != 0:
+                if ident != '0':
                     result.append('  %s:       refcount=%s\n    %s' %
                                   (ident, self.id_to_refcount[ident],
                                    str(self.id_to_obj[ident][0])[:75]))
@@ -310,7 +310,7 @@
         '''
         Number of shared objects
         '''
-        return len(self.id_to_obj) - 1      # don't count ident=0
+        return len(self.id_to_obj) - 1      # don't count ident='0'
 
     def shutdown(self, c):
         '''

Modified: python/trunk/Lib/test/test_multiprocessing.py
==============================================================================
--- python/trunk/Lib/test/test_multiprocessing.py	(original)
+++ python/trunk/Lib/test/test_multiprocessing.py	Wed Jan 21 03:08:17 2009
@@ -1057,8 +1057,10 @@
         multiprocessing.active_children()  # discard dead process objs
         gc.collect()                       # do garbage collection
         refs = self.manager._number_of_objects()
+        debug_info = self.manager._debug_info()
         if refs != EXPECTED_NUMBER:
             print self.manager._debug_info()
+            print debug_info
 
         self.assertEqual(refs, EXPECTED_NUMBER)
 


More information about the Python-checkins mailing list