Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: <lambda>() got an unexpected keyword argument 'time_out' #10

Open
cyrus opened this issue Sep 22, 2015 · 12 comments
Open

TypeError: <lambda>() got an unexpected keyword argument 'time_out' #10

cyrus opened this issue Sep 22, 2015 · 12 comments

Comments

@cyrus
Copy link
Contributor

cyrus commented Sep 22, 2015

    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)

@tmalsburg
Copy link
Owner

Difficult to tell without more context. At which stage during the test did this happen?

@tmalsburg
Copy link
Owner

Did the test otherwise work correctly?

@cyrus
Copy link
Contributor Author

cyrus commented Sep 23, 2015

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

@tmalsburg
Copy link
Owner

I have a vague idea about what might go wrong but in order to test it we need recipe for replicating this exception.

@cyrus
Copy link
Contributor Author

cyrus commented Sep 23, 2015

OK. I will try to make a minimal example.

@tmalsburg
Copy link
Owner

It doesn't need to be minimal. Just find a way to reliably replicate the problem with your English test. Thanks!

@tmalsburg tmalsburg changed the title Saw this when running myself. TypeError: <lambda>() got an unexpected keyword argument 'time_out' Sep 23, 2015
@cyrus
Copy link
Contributor Author

cyrus commented Sep 24, 2015

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'

@tmalsburg
Copy link
Owner

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.

@tmalsburg
Copy link
Owner

tmalsburg commented Sep 24, 2015

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).

@tmalsburg
Copy link
Owner

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.

@cyrus
Copy link
Contributor Author

cyrus commented Sep 24, 2015

Glad it was nothing serious. :-)

@tmalsburg
Copy link
Owner

Thanks for reporting this, Cyrus!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants