← Back to team overview

launchpad-dev team mailing list archive

Launchpadlib: can not search for bug-tasks with status "Unknown"

 

Bug tasks can have the status "Unknown", but one can't search for bugs with 
this status with Launchpadlib. 

This is a possibly a bug in Launchpadlib, although a relatively esoteric one, 
because one can't set this status in the web interface. 
Is this the intended behavior, or should I file a bug report?

Here is the script to reproduce the error:


from launchpadlib.launchpad import Launchpad
launchpad = Launchpad.login_with("test", "production")

bt1 = launchpad.load(
    "https://api.launchpad.net/1.0/bug-repo-syncer/+bug/941393";)
#bt1.status = "Unknown"
#bt1.lp_save()
print "bt1.title:", bt1.title
print "bt1.status:", bt1.status

project = launchpad.projects["bug-repo-syncer"]
utasks = project.searchTasks(status=["Unknown"])


It fails with the following backtrace:

Traceback (most recent call last):
  File "lpbugstatus.py", line 12, in <module>
    utasks = project.searchTasks(status=["Unknown"])
  File "/usr/local/lib/python2.7/site-
packages/lazr/restfulclient/resource.py", line 573, in __call__
    url, in_representation, http_method, extra_headers=extra_headers)
  File "/usr/local/lib/python2.7/site-
packages/lazr/restfulclient/_browser.py", line 281, in _request
    raise error
lazr.restfulclient.errors.BadRequest: HTTP Error 400: Bad Request
Response headers:
---
-content-encoding: gzip
connection: close
content-length: 230
content-type: text/plain;charset=utf-8
date: Thu, 08 Mar 2012 09:13:57 GMT
server: zope.server.http (HTTP)
status: 400
strict-transport-security: max-age=2592000
vary: Accept,Accept-Encoding
via: 1.1 api.launchpad.net
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-lazr-notifications: []
x-powered-by: Zope (www.zope.org), Python (www.python.org)
x-xss-protection: 1; mode=block
---
Response body:
---
status: Invalid value "Unknown". Acceptable values are: New, Incomplete, 
Opinion, Invalid, Won't Fix, Expired, Confirmed, Triaged, In Progress, Fix 
Committed, Fix Released, Incomplete (with response), Incomplete (without 
response)
---



Follow ups