Test selection screen empty and TypeError: __init__() takes from 1 to 6 positional arguments but 7 were given

Bug #1097866 reported by Daniel Manrique on 2013-01-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox
Critical
Daniel Manrique

Bug Description

This was observed with Checkbox 0.14.9.1 and trunk rev 1874 on a Raring daily image from 20130109.

Steps to reproduce:
- Start checkbox-qt

Expected result:
- Checkbox asks for sudo password
- Test selection screen is shown
- Selected tests run
- Report shown at the end

Actual result:
- Test selection screen is empty.
- A trace (posted below) in the log.
- If using --log-level=debug, checkbox complains that all patterns in whitelist are unused
- Selecting "start testing" goes straight into generating report
- Report generation stalls forever and an error about a missing "report" attribute appears in the log.

2013-01-09 12:08:55,896 ERROR Error running event handler checkbox.lib.cache.Cache for event type 'prompt-gather'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/checkbox/reactor.py", line 74, in fire results.append(handler(*args, **kwargs))
  File "/usr/lib/python3/dist-packages/checkbox/lib/cache.py", line 31, in __call__
    self._cache[(self._instance,) + args] = self._function(self._instance, *args)
  File "<string>", line 36, in prompt_gather
  File "/usr/lib/python3/dist-packages/checkbox/user_interface.py", line 116, in
 show_progress
    args=args, kwargs=kwargs)
  File "/usr/lib/python3/dist-packages/checkbox/contrib/REThread.py", line 25, in __init__
    verbose)
TypeError: __init__() takes from 1 to 6 positional arguments but 7 were given

checkbox/contrib/REThread.py creates a thread like this:
        threading.Thread.__init__(self, group, target, name, args, kwargs, verbose)

Note that all arguments are positional, however per Python 3.3 documentation (http://docs.python.org/3/library/threading.html?highlight=threading.thread#threading.Thread) "This constructor should always be called with keyword arguments" . Apparently this just became more strict and as a result, our way of invoking the constructor is now invalid.

To fix this, the call to this constructor needs to be changed to use keyword arguments, save for the first (self) which *does* need to be positional.

threading.Thread.__init__(self, group=group, target=target, name=name, args=args, kwargs=kwargs, daemon=verbose)

With this change applied behavior is as expected.

Related branches

Daniel Manrique (roadmr) on 2013-01-09
Changed in checkbox:
assignee: nobody → Daniel Manrique (roadmr)
importance: Undecided → Critical
status: New → In Progress
Zygmunt Krynicki (zyga) on 2013-01-09
Changed in checkbox:
status: In Progress → Fix Committed
Daniel Manrique (roadmr) on 2013-01-10
Changed in checkbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers