Setting an attribute on a shim object without first reading an attribute causes a crash
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lazr.restfulclient |
Triaged
|
Low
|
Unassigned |
Bug Description
Code like this:
project = launchpad.
foo.bar = 'baz'
Will yield a traceback like this:
Traceback (most recent call last):
File "./security-
self.
File "./security-
project.
File "/usr/lib/
if not self.lp_
File "/usr/lib/
return self._get_
File "/usr/lib/
if self._wadl_
File "/usr/lib/
definition = self._find_
File "/usr/lib/
"Resource is not bound to any representation, and no media "
NoBoundRepresen
First off, "media media type" is a typo. Second, you should probably be able to set a parameter on a shim object without having to get the current representation. Or if you can't (because you don't know what the ETag is, so you can't send a conditional PATCH), setting a parameter value on a shim object should fetch the representation, just as getting a parameter value does.
Changed in lazr.restfulclient: | |
status: | New → Triaged |
importance: | Undecided → Low |
I ran into this while changing the default branch for a bunch of projects when debian-installer moved to git. The workaround (thanks to leonardr) was to do '_ = focus.name' before trying to set focus.branch (where focus was a project_series object).