Bug tags need to be a JSON list, but documentation says plain text
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Triaged
|
Low
|
Unassigned |
Bug Description
According to the WADL Description the 'tags' argument has to be separated by whitespace, but this returns a HTTPError:
In [12]: b = launchpad.
-------
<class 'launchpadlib.
/media/
/media/
238 extra_headers = { 'Content-type' : media_type }
239 response, content = self.root.
--> 240 url, in_representation, http_method, extra_headers=
url = u'https:/
http_method = 'post'
241
242 if response.status == 201:
/media/
70 # Turn non-2xx responses into exceptions.
71 if response.status // 100 != 2:
---> 72 raise HTTPError(response, content)
global HTTPError = <class 'launchpadlib.
response = {'status': '400', 'content-length': '15', 'via': '1.1 wildcard.
content = 'tags: [foo bar]'
73 return response, content
74
<class 'launchpadlib.
Changed in launchpadlib: | |
importance: | Undecided → Low |
status: | New → Triaged |
tags: | added: bugtag |
Ok, this is a bit confusing. A json encoded representation of a list seems to be necessary:
In [23]: x = simplejson. dumps([ "boo"," bar"])
In [24]: b = launchpad. bugs.createBug( target= "https:/ /api.staging. launchpad. net/beta/ ubuntu", title="this is a test", description="this is the description of the test\nThis bug was created by launchpadlib", tags=x)
In [25]: b /api.staging. launchpad. net/beta/ bugs/256503>
Out[25]: <bug at https:/
Can this json serialization be done internally? - this is also a reason why setting boolean values is not working as expected.
launchpad. bugs.createBug( target= "https:/ /api.staging. launchpad. net/beta/ ubuntu", title="this is a test", description="this is the description of the test\nThis bug was created by launchpadlib", private=True)
this fails with a HTTPError, content = "private: got 'unicode', expected bool: u'True'"