Closed hhlp closed 2 years ago
I got the same, on Windows 11.
Could you tell me the output of
import psutil
print([
item.mountpoint
for item in psutil.disk_partitions()
if not item.device.startswith("/dev/loop")
])
on your machine?
Python 3.10.1 (tags/v3.10.1:2cd268a, Dec 6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> print([
... item.mountpoint
... for item in psutil.disk_partitions()
... if not item.device.startswith("/dev/loop")
... ])
['C:\\', 'D:\\', 'F:\\', 'H:\\', 'I:\\', 'J:\\', 'K:\\']
This looks good. How about
psutil.disk_usage("C:\\").total
? (Perhaps also check the other drives.)
H to K give
>>> psutil.disk_usage("H:\\").total
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Gustav\.local\pipx\venvs\tiptop\lib\site-packages\psutil\__init__.py", line 2003, in disk_usage
return _psplatform.disk_usage(path)
File "C:\Users\Gustav\.local\pipx\venvs\tiptop\lib\site-packages\psutil\_pswindows.py", line 274, in disk_usage
total, free = cext.disk_usage(path)
PermissionError: [WinError 21] The device is not ready: 'H'
Those four are slots on a USB card reader that don't have cards in them, so "not ready" is the correct result, I'd say.
Could you update to 0.2.2 and try again please?
Could you tell me the output of
import psutil print([ item.mountpoint for item in psutil.disk_partitions() if not item.device.startswith("/dev/loop") ])
on your machine?
This is mine:
Python 3.10.2 (main, Jan 17 2022, 00:00:00) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> print([
... item.mountpoint
... for item in psutil.disk_partitions()
... if not item.device.startswith("/dev/loop")
... ])
['/', '/boot', '/home', '/boot/efi', '/mnt/WD_1', '/var/lib/docker/btrfs', '/run/media/hhlp/My Book']
>>>
regards.,
@hhlp Could you also try the latest version, and, if it still fails, repeat the steps I outlined above?
Works for me now - thanks for the amazingly fast turnaround!
Cool. Let's close this then.
Works for me too.....
Regards.,
My machine:
OS: Fedora release 35 (Thirty Five) Host: MS-7D54 1.0 Kernel: 5.16.12-200.fc35.x86_64 Shell: zsh 5.8.1 DE: GNOME 41.4 WM: Mutter Terminal: tilix CPU: AMD Ryzen 9 5900X (24) @ 3.700GHz GPU: NVIDIA GeForce GT 730 Memory: 32078MiB 2 SSD 1.- nvme and 2.- normal SSD card 1 SATA 4TB Memory: 32078MiB
Regards.,
This is what I've Got: