Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9cd7e176
Commit
9cd7e176
authored
Feb 10, 2017
by
Łukasz Langa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #29519: weakref spewing exceptions during interp finalization
parent
e6624452
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
Lib/weakref.py
Lib/weakref.py
+2
-2
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/weakref.py
View file @
9cd7e176
...
@@ -106,7 +106,7 @@ class WeakValueDictionary(collections.MutableMapping):
...
@@ -106,7 +106,7 @@ class WeakValueDictionary(collections.MutableMapping):
self
,
*
args
=
args
self
,
*
args
=
args
if
len
(
args
)
>
1
:
if
len
(
args
)
>
1
:
raise
TypeError
(
'expected at most 1 arguments, got %d'
%
len
(
args
))
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
()
self
=
selfref
()
if
self
is
not
None
:
if
self
is
not
None
:
if
self
.
_iterating
:
if
self
.
_iterating
:
...
@@ -114,7 +114,7 @@ class WeakValueDictionary(collections.MutableMapping):
...
@@ -114,7 +114,7 @@ class WeakValueDictionary(collections.MutableMapping):
else
:
else
:
# Atomic removal is necessary since this function
# Atomic removal is necessary since this function
# can be called asynchronously by the GC
# can be called asynchronously by the GC
_
remove_dead_weakref
(
d
,
wr
.
key
)
_
atomic_removal
(
d
,
wr
.
key
)
self
.
_remove
=
remove
self
.
_remove
=
remove
# A list of keys to be removed
# A list of keys to be removed
self
.
_pending_removals
=
[]
self
.
_pending_removals
=
[]
...
...
Misc/NEWS
View file @
9cd7e176
...
@@ -23,6 +23,9 @@ Extension Modules
...
@@ -23,6 +23,9 @@ Extension Modules
Library
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 #29416: Prevent infinite loop in pathlib.Path.mkdir
- Issue #29444: Fixed out-of-bounds buffer access in the group() method of
- Issue #29444: Fixed out-of-bounds buffer access in the group() method of
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment