Message283279
Here's another way to reproduce the error. The problem seems to be in the C implementation of _lru_cache_wrapper() / bounded_lru_cache_wrapper().
$ cat test.py
import functools
import threading
import time
@functools.lru_cache(maxsize=2)
def f(v):
time.sleep(.01)
threads = [threading.Thread(target=f, args=(v,)) for v in [1,2,2,3,2]]
for t in threads:
t.start()
$ ./python test.py
Exception in thread Thread-5:
Traceback (most recent call last):
File "/somewhere/Lib/threading.py", line 916, in _bootstrap_inner
self.run()
File "/somewhere/Lib/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
KeyError: (2,)
$ ./python
Python 3.7.0a0 (default:654ec6ed3225+, Dec 15 2016, 11:24:30)
[GCC 4.8.4] on linux |
|
Date |
User |
Action |
Args |
2016-12-15 10:36:25 | peter.otten | set | recipients:
+ peter.otten, rhettinger, serhiy.storchaka, Nicolas Savoire |
2016-12-15 10:36:25 | peter.otten | set | messageid: <1481798185.65.0.892419002483.issue28969@psf.upfronthosting.co.za> |
2016-12-15 10:36:25 | peter.otten | link | issue28969 messages |
2016-12-15 10:36:25 | peter.otten | create | |
|