dcantrell / pyparted

Python bindings for GNU parted (libparted)
GNU General Public License v2.0
85 stars 42 forks source link

tests: Remove DeviceFreeAllTestCase #97

Closed bcl closed 1 year ago

bcl commented 1 year ago

This test calls _ped.device_free_all(), which destroys all the devices in libparted's devices list, and it frees the memory allocated for the device.

But there may still be objects pointing to that memory, and when they are garbage collected pyparted can crash with a Floating Point Error if it hits a divide by 0.

This should usually never be called, but if it is it must only be called after all the users of the device have been freed first. In python there is no way to guarantee that.