appending tags to bug.tags is not supported properly on lp_save()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
launchpadlib |
Triaged
|
Low
|
Unassigned |
Bug Description
Other then documented in the reference (http://
In [38]: b = launchpad.
In [39]: b.tags
Out[39]: [u'bar', u'foo']
In [40]: b.tags.
n [41]: b._dirty_attributes
Out[41]: {}
This only works for changing the complete object:
In [42]: b.tags = ["bood"]
In [43]: b._dirty_attributes
Out[43]: {'tags': ['bood']}
Markus
---
Workaround: rather than appending to the list, set the attribute to a new list that has the value you want:
Not: b.tags.
but rather: b.tags = b.tags + ['foo']
Changed in launchpadlib: | |
importance: | Undecided → Low |
status: | Confirmed → Triaged |
tags: | added: oem-services |
description: | updated |
It's not really practical to monitor a list for changes; we'd have to wrap it in a proxy object that knew about the entire Python list interface. We could prevent the problem by deserializing tags into a tuple rather than a list. Then you'd know you had to replace the tuple with another one.