TypeError when lazr.restful tries to unmarshall URI
Bug #474522 reported by
Gary Poster
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Invalid
|
High
|
Leonard Richardson | ||
lazr.restful |
Invalid
|
High
|
Unassigned |
Bug Description
OOPS-1403ED45 shows a problem in which lazr.restful tries to unmarshall a URI, but lazr.uri complains, ``TypeError: expected string or buffer``. I first guessed that this was caused by passing None, but in this case the error was on rev 9826, which used lazr.restful 0.9.13, which does check for None in lazr.restful.
Changed in launchpad-foundations: | |
status: | New → Triaged |
importance: | Undecided → High |
assignee: | nobody → Leonard Richardson (leonardr) |
tags: | added: api oops |
Changed in lazr.restful: | |
status: | New → Triaged |
importance: | Undecided → High |
To post a comment you must log in.
This launchpadlib code will reproduce:
bug = launchpad. bugs[40000]
bug.owner = 42
bug.lp_save()
The problem is not that the object is None, but that it's not a string. Since only a string can be a valid URI, checking the type in the marshaller seems like a good way to solve the problem.
If you try to set a string field to a number, you 400 Bad Request and this error:
name: got 'int', expected unicode: 44
I'm not sure why that behavior isn't inherited.