This short function is simply getting the available free space of a storage device, however I am getting the above error when running the code.
The function is:
def disk_space1(drive):
freespace = ctypes.c_ulonglong()
calcspace = ctypes.windll.kernel32.GetDiskFreeSpaceExA
calcspace(drive, ctypes.byref(freespace))
disk_size = freespace.value
return disk_size
This function worked perfectly until today when it has stopped working for no reason, I haven't changed anything. What's baffling me the most is that the function works properly, if I print out the value of 'freespace' once running it, it has gone and found the correct value, but still gives the error.
What could have caused this issue?