]> granicus.if.org Git - python/commit
bpo-35615: Fix crashes when copying a Weak{Key,Value}Dictionary. (GH-11384)
authorFish <ltfish@users.noreply.github.com>
Thu, 7 Feb 2019 19:51:59 +0000 (14:51 -0500)
committerAntoine Pitrou <pitrou@free.fr>
Thu, 7 Feb 2019 19:51:59 +0000 (19:51 +0000)
commit96d37dbcd23e65a7a57819aeced9034296ef747e
treef8a5c4d702642dbc6da04a85d818ae7689d5a1db
parentdf8d2cde63c865446468351f8f648e1c7bd45109
bpo-35615: Fix crashes when copying a Weak{Key,Value}Dictionary. (GH-11384)

Protect dict iterations by wrapping them with _IterationGuard in the
following methods:

- WeakValueDictionary.copy()
- WeakValueDictionary.__deepcopy__()
- WeakKeyDictionary.copy()
- WeakKeyDictionary.__deepcopy__()
Lib/test/test_weakref.py
Lib/weakref.py
Misc/NEWS.d/next/Library/2018-12-30-20-00-05.bpo-35615.Uz1SVh.rst [new file with mode: 0644]