This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author peter.otten
Recipients Nicolas Savoire, peter.otten, rhettinger, serhiy.storchaka
Date 2016-12-15.10:36:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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
import functools
import threading
import time

def f(v):

threads = [threading.Thread(target=f, args=(v,)) for v in [1,2,2,3,2]]
for t in threads:

$ ./python
Exception in thread Thread-5:
Traceback (most recent call last):
  File "/somewhere/Lib/", line 916, in _bootstrap_inner
  File "/somewhere/Lib/", 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:25peter.ottensetrecipients: + peter.otten, rhettinger, serhiy.storchaka, Nicolas Savoire
2016-12-15 10:36:25peter.ottensetmessageid: <>
2016-12-15 10:36:25peter.ottenlinkissue28969 messages
2016-12-15 10:36:25peter.ottencreate