Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | bpo-44962: Fix a race in WeakKeyDict, WeakValueDict and WeakSet when two ↵ | Thomas Grainger | 2021-08-28 | 1 | -3/+7 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | threads attempt to commit the last pending removal (GH-27921) Fixes: Traceback (most recent call last): File "/home/graingert/projects/asyncio-demo/demo.py", line 36, in <module> sys.exit(main()) File "/home/graingert/projects/asyncio-demo/demo.py", line 30, in main test_all_tasks_threading() File "/home/graingert/projects/asyncio-demo/demo.py", line 24, in test_all_tasks_threading results.append(f.result()) File "/usr/lib/python3.10/concurrent/futures/_base.py", line 438, in result return self.__get_result() File "/usr/lib/python3.10/concurrent/futures/_base.py", line 390, in __get_result raise self._exception File "/usr/lib/python3.10/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/usr/lib/python3.10/asyncio/runners.py", line 47, in run _cancel_all_tasks(loop) File "/usr/lib/python3.10/asyncio/runners.py", line 56, in _cancel_all_tasks to_cancel = tasks.all_tasks(loop) File "/usr/lib/python3.10/asyncio/tasks.py", line 53, in all_tasks tasks = list(_all_tasks) File "/usr/lib/python3.10/_weakrefset.py", line 60, in __iter__ with _IterationGuard(self): File "/usr/lib/python3.10/_weakrefset.py", line 33, in __exit__ w._commit_removals() File "/usr/lib/python3.10/_weakrefset.py", line 57, in _commit_removals discard(l.pop()) IndexError: pop from empty list Also fixes: Exception ignored in: weakref callback <function WeakKeyDictionary.__init__.<locals>.remove at 0x00007fe82245d2e0> Traceback (most recent call last): File "/usr/lib/pypy3/lib-python/3/weakref.py", line 390, in remove del self.data[k] KeyError: <weakref at 0x00007fe76e8d8180; dead> Exception ignored in: weakref callback <function WeakKeyDictionary.__init__.<locals>.remove at 0x00007fe82245d2e0> Traceback (most recent call last): File "/usr/lib/pypy3/lib-python/3/weakref.py", line 390, in remove del self.data[k] KeyError: <weakref at 0x00007fe76e8d81a0; dead> Exception ignored in: weakref callback <function WeakKeyDictionary.__init__.<locals>.remove at 0x00007fe82245d2e0> Traceback (most recent call last): File "/usr/lib/pypy3/lib-python/3/weakref.py", line 390, in remove del self.data[k] KeyError: <weakref at 0x000056548f1e24a0; dead> See: https://github.com/agronholm/anyio/issues/362#issuecomment-904424310 See also: https://bugs.python.org/issue29519 Co-authored-by: Łukasz Langa <lukasz@langa.pl> | ||||
* | bpo-39481: Make weakref and WeakSet generic (GH-19497) | Ethan Smith | 2020-04-13 | 1 | -0/+3 |
| | |||||
* | bpo-36949: Implement __repr__ on WeakSet (GH-13415) | Batuhan Taşkaya | 2019-05-20 | 1 | -0/+3 |
| | |||||
* | bpo-30296 Remove unnecessary tuples, lists, sets, and dicts (#1489) | Jon Dufresne | 2017-05-18 | 1 | -3/+3 |
| | | | | | | | | * Replaced list(<generator expression>) with list comprehension * Replaced dict(<generator expression>) with dict comprehension * Replaced set(<list literal>) with set literal * Replaced builtin func(<list comprehension>) with func(<generator expression>) when supported (e.g. any(), all(), tuple(), min(), & max()) | ||||
* | bpo-29762: More use "raise from None". (#569) | Serhiy Storchaka | 2017-04-05 | 1 | -1/+1 |
| | | | This hides unwanted implementation details from tracebacks. | ||||
* | Issue #20006: Fix sporadic failures in test_weakset. | Antoine Pitrou | 2013-12-18 | 1 | -0/+2 |
| | |||||
* | Issue #14195: Make WeakSet.__lt__ and WeakSet.__gt__ irreflexive. | Meador Inge | 2012-03-04 | 1 | -6/+6 |
| | |||||
* | Fix some set algebra methods of WeakSet objects. | Antoine Pitrou | 2012-03-04 | 1 | -29/+12 |
| | |||||
* | Port 2.7 fix for sporadic failure in test_weakset. | Antoine Pitrou | 2012-03-04 | 1 | -5/+2 |
| | |||||
* | Issue #14159: Fix the len() of weak containers (WeakSet, WeakKeyDictionary, ↵ | Antoine Pitrou | 2012-03-01 | 1 | -1/+1 |
| | | | | | | | WeakValueDictionary) to return a better approximation when some objects are dead or dying. Moreover, the implementation is now O(1) rather than O(n). Thanks to Yury Selivanov for reporting. | ||||
* | #10360: catch TypeError in WeakSet.__contains__, just like WeakKeyDictionary ↵ | Georg Brandl | 2010-12-03 | 1 | -1/+5 |
| | | | | does. | ||||
* | Issue #7105: Make WeakKeyDictionary and WeakValueDictionary robust against | Antoine Pitrou | 2010-01-08 | 1 | -5/+69 |
| | | | | the destruction of weakref'ed objects while iterating. | ||||
* | Issue 5964: Fixed WeakSet __eq__ comparison to handle non-WeakSet objects. | Robert Schuppenies | 2009-05-17 | 1 | -0/+2 |
| | |||||
* | Add a test suite for WeakSet mostly derived from test_set and fix some | Georg Brandl | 2008-05-18 | 1 | -12/+42 |
| | | | | issues in the weakset implementation discovered with it. | ||||
* | Fix two issues in the weak set implementation. | Georg Brandl | 2008-05-18 | 1 | -2/+5 |
| | |||||
* | Moved WeakSet into a bootstap module use by abc.py. | Raymond Hettinger | 2008-02-05 | 1 | -0/+111 |
This makes it possible to use ABCs in weakref.py (which will be done in a later checkin). |