py-span-task
py-span-task copied to clipboard
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
Any idea why this happened? (This was with the English Operation Span version)
Difficult to tell without more context. At which stage during the test did this happen?
Did the test otherwise work correctly?
Sorry for the delay.
The experiment saved the data correctly, I think! It threw the exception between trials 11 and 12. I am not sure what happened then. Could I have accidentally pressed an invalid key?
-Cyrus
trial: test 9
presented: g, p, k, t, s
entered: g, p, k, t, s
correct: 5 out of 5
trial: test 10
presented: c, j, v, w, d
entered: c, j, v, w, t
correct: 4 out of 5
trial: test 11
presented: n, l, f, s, p
entered: n, l, f, s, p
correct: 5 out of 5
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
trial: test 12
presented: r, t, g
entered: r, t
correct: 2 out of 3
I have a vague idea about what might go wrong but in order to test it we need recipe for replicating this exception.
OK. I will try to make a minimal example.
It doesn't need to be minimal. Just find a way to reliably replicate the problem with your English test. Thanks!
It looks like it happens when I press any key other than the two keys I set up in the config file (in my case, "c" and "i".
In the the events below I was pressing the wrong keys a lot....
Does this happen to you too?
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() takes exactly 3 arguments (2 given)
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() takes exactly 3 arguments (2 given)
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() takes exactly 3 arguments (2 given)
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() takes exactly 3 arguments (2 given)
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() takes exactly 3 arguments (2 given)
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() takes exactly 3 arguments (2 given)
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() takes exactly 3 arguments (2 given)
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() takes exactly 3 arguments (2 given)
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() takes exactly 3 arguments (2 given)
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() takes exactly 3 arguments (2 given)
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() takes exactly 3 arguments (2 given)
trial: practice 1
presented: x, h, p
entered: c, s, p
correct: 1 out of 3
trial: practice 2
presented: w, j, b
entered: c, s, d
correct: 0 out of 3
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 104, in <lambda>
self.bind('<space>', lambda e:self.key_pressed('<space>'))
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
trial: practice 3
presented: f, l
entered: c, c, c
correct: 0 out of 2
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
trial: practice 4
presented: n, k
entered: j, c, c
correct: 0 out of 2
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 104, in <lambda>
self.bind('<space>', lambda e:self.key_pressed('<space>'))
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 104, in <lambda>
self.bind('<space>', lambda e:self.key_pressed('<space>'))
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
trial: test 1
presented: v, z
entered: c, v
correct: 1 out of 2
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 104, in <lambda>
self.bind('<space>', lambda e:self.key_pressed('<space>'))
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 104, in <lambda>
self.bind('<space>', lambda e:self.key_pressed('<space>'))
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
trial: test 2
presented: m, s, g, t
entered: j, d, s
correct: 1 out of 4
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 104, in <lambda>
self.bind('<space>', lambda e:self.key_pressed('<space>'))
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
trial: test 3
presented: r, d, q
entered: i, d
correct: 1 out of 3
trial: test 4
presented: c, j, d, n, c
entered: i, j, d, n
correct: 3 out of 5
trial: test 5
presented: r, s
entered: r, s
correct: 2 out of 2
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
trial: test 6
presented: x, b, z, l
entered: i, d, a
correct: 0 out of 4
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
trial: test 7
presented: p, v, h, w, q
entered: c, c, c
correct: 0 out of 5
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 104, in <lambda>
self.bind('<space>', lambda e:self.key_pressed('<space>'))
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
trial: test 8
presented: k, g, m
entered: i, c, d
correct: 0 out of 3
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
return self.func(*args)
File "../pyspantask.py", line 108, in <lambda>
return lambda e:frame.key_pressed(key)
File "../pyspantask.py", line 119, in key_pressed
self.scripts[0].next(self, key, **self.opts)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
There are two different kinds of exceptions:
TypeError: <lambda>() takes exactly 3 arguments (2 given)
TypeError: <lambda>() got an unexpected keyword argument 'time_out'
I think the first only occurs during the practice phase and the second only during the main test. The underlying cause is probably similar but I still haven't figured out when exactly I have to press the wrong keys in order to generate these exceptions. Either way, the exceptions are likely harmless because nothing is supposed to happen anyway when a wrong key is pressed. So the exceptions do not interfere with the test. But of course it's better to fix this anyway.
The first error doesn't occur when a wrong key is pressed. It happens when a correct key is pressed while the feedback is shown ("oops" or "very good"). In fact, wrong keys can't trigger anything because no event handlers are bound to keys other than those needed for responses or aborting the program (esc).
The second error occurs when a correct key is pressed while a memory item (a letter) is displayed. Both errors are completely harmless. I'll think about a fix.
Glad it was nothing serious. :-)
Thanks for reporting this, Cyrus!