summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author?ukasz Langa <lukasz@langa.pl>2017-02-10 00:16:10 -0800
committer?ukasz Langa <lukasz@langa.pl>2017-02-10 00:16:10 -0800
commitc7a3f78cc193bfa7fc874f49ec2e0799b32da817 (patch)
tree84433de1f75d1f6d1a541a8eee251d48321d6f32
parent68aff055c847d6f8cfbf75e413f514d98573d43d (diff)
parent4b1bb99319543d67de2c6754a1dcc13d334aaa2d (diff)
downloadcpython-c7a3f78cc193bfa7fc874f49ec2e0799b32da817.tar.gz
Merge 3.5 (fix #29519)
-rw-r--r--Lib/weakref.py4
-rw-r--r--Misc/NEWS3
2 files changed, 5 insertions, 2 deletions
diff --git a/Lib/weakref.py b/Lib/weakref.py
index aaebd0c464..787e33a327 100644
--- a/Lib/weakref.py
+++ b/Lib/weakref.py
@@ -106,7 +106,7 @@ class WeakValueDictionary(collections.MutableMapping):
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 @@ class WeakValueDictionary(collections.MutableMapping):
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
index a2d42414c2..cec19c6f52 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -57,6 +57,9 @@ Extension Modules
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