Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 57fe245

Browse files
committed
Merge 3.5 (fix python#29519)
2 parents 35a1f7f + 9cd7e17 commit 57fe245

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Lib/weakref.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ def __init__(*args, **kw):
106106
self, *args = args
107107
if len(args) > 1:
108108
raise TypeError('expected at most 1 arguments, got %d' % len(args))
109-
def remove(wr, selfref=ref(self)):
109+
def remove(wr, selfref=ref(self), _atomic_removal=_remove_dead_weakref):
110110
self = selfref()
111111
if self is not None:
112112
if self._iterating:
113113
self._pending_removals.append(wr.key)
114114
else:
115115
# Atomic removal is necessary since this function
116116
# can be called asynchronously by the GC
117-
_remove_dead_weakref(d, wr.key)
117+
_atomic_removal(d, wr.key)
118118
self._remove = remove
119119
# A list of keys to be removed
120120
self._pending_removals = []

Misc/NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ Extension Modules
5757
Library
5858
-------
5959

60+
- Issue #29519: Fix weakref spewing exceptions during interpreter shutdown
61+
when used with a rare combination of multiprocessing and custom codecs.
62+
6063
- Issue #29416: Prevent infinite loop in pathlib.Path.mkdir
6164

6265
- Issue #29444: Fixed out-of-bounds buffer access in the group() method of

0 commit comments

Comments
 (0)