Transitioning to a new status using the API is unintuitive
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Undecided
|
Leonard Richardson |
Bug Description
I tried to change a bug status with launchpadlib. My first, and IMHO intuitive approach:
>>> b = launchpad.
>>> b.bug_tasks[
u'Invalid'
>>> b.bug_tasks[
>>> b.lp_save()
>>>
However, that didn't help, bug 89040 stayed at "Invalid".
After consulting Gavin on IRC, he told me that this needs transitionToSta
>>> b.bug_tasks[
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: __call__() takes exactly 1 argument (2 given)
the first implicit argument is "self", and certainly it needs the new status? help() only brings some boilerplate, and https:/
Since this isn't going to change, we need to:
* Improve the documentation
* Throw more informative errors
Related branches
Changed in malone: | |
status: | Fix Committed → Fix Released |
I figured it out :)
It should be:
>>> b.bug_tasks[ 0].transitionTo Status( status= 'Confirmed' )
Iirc, all the methods in the LP API like this one take keyword
arguments only. We definitely need to make that more obvious, and we
should try to give better errors in launchpadlib for this kinds of
things.
Fixing this bug therefore requires that the documentation and error
reporting is made clearer.