[Python-checkins] cpython (merge 3.5 -> 3.6): Merge 3.5 (fix #29519)

lukasz.langa python-checkins at python.org
Fri Feb 10 03:20:39 EST 2017


https://hg.python.org/cpython/rev/c5267272e66a
changeset:   106486:c5267272e66a
branch:      3.6
parent:      106483:59e54de17dd8
parent:      106485:2cb530243943
user:        Łukasz Langa <lukasz at langa.pl>
date:        Fri Feb 10 00:16:10 2017 -0800
summary:
  Merge 3.5 (fix #29519)

files:
  Lib/weakref.py |  4 ++--
  Misc/NEWS      |  3 +++
  2 files changed, 5 insertions(+), 2 deletions(-)


diff --git a/Lib/weakref.py b/Lib/weakref.py
--- a/Lib/weakref.py
+++ b/Lib/weakref.py
@@ -106,7 +106,7 @@
         self, *args = args
         if len(args) > 1:
             raise TypeError('expected at most 1 arguments, got %d' % len(args))
-        def remove(wr, selfref=ref(self)):
+        def remove(wr, selfref=ref(self), _atomic_removal=_remove_dead_weakref):
             self = selfref()
             if self is not None:
                 if self._iterating:
@@ -114,7 +114,7 @@
                 else:
                     # Atomic removal is necessary since this function
                     # can be called asynchronously by the GC
-                    _remove_dead_weakref(d, wr.key)
+                    _atomic_removal(d, wr.key)
         self._remove = remove
         # A list of keys to be removed
         self._pending_removals = []
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -57,6 +57,9 @@
 Library
 -------
 
+- Issue #29519: Fix weakref spewing exceptions during interpreter shutdown
+  when used with a rare combination of multiprocessing and custom codecs.
+
 - Issue #29416: Prevent infinite loop in pathlib.Path.mkdir
 
 - Issue #29444: Fixed out-of-bounds buffer access in the group() method of

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list