Disk.target seems to be writable but fails when you try to do so

Bug #686004 reported by Guilherme Salgado
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-parted (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: python-parted

Disk.target is implemented as a property with a setter but that will try to set the .type of the underlying PedDisk object, which is readonly. I'd report this bug upstream but the captcha at https://admin.fedoraproject.org is unbeatable.

>>> disk = Disk(device=d)
>>> disk.type
'mac'
>>> disk.type = 'msdos'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/pymodules/python2.6/parted/disk.py", line 194, in <lambda>
    type = property(lambda s: s.__disk.type.name, lambda s, v: setattr(s.__disk, "type", parted.diskType[v]))
TypeError: readonly attribute

>>> ped= disk.getPedDisk()
>>> ped.type = parted.diskType['msdos']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: readonly attribute

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.