Assert self->cxt before calling libfdisk fdisk_assign_device. Also check for its return code and raise exception if libfdisk report any error assigning the device.