[issue38825] psutil.disk_usage - Lacking documentation
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
New submission from Lord Anton Hvornum <anton.doxid@gmail.com>: https://docs.python.org/3.8/library/shutil.html#shutil.disk_usage There's no mention that this helper function simply calls `os.statvfs()` in the background. Something that is quite troubling when you're trying to get disk_usage (or disk-information) about a non-mounted drive. It's clear as day if you see the code: https://github.com/python/cpython/blob/master/Lib/shutil.py#L1249 But if you're a novice user, this will puzzle your brain. Because the end result will be that `disk_usage()` returns the same information for all these cases: shutil.disk_usage('/dev/sda') shutil.disk_usage('/dev/sdb') shutil.disk_usage('/dev/sdc') Which translates to: os.statvfs('/dev/sd?')' -- All I'm asking, is that we add a little note stating: "On *mounted* filesystems" or a reference to `os.statvfs()` where it's clearly stated that it runs on mounted filesystems. Thanks in advance. ---------- assignee: docs@python components: Documentation messages: 356771 nosy: Lord Anton Hvornum, docs@python priority: normal severity: normal status: open title: psutil.disk_usage - Lacking documentation type: enhancement versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38825> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Karthikeyan Singaravelan <tir.karthi@gmail.com> added the comment: I modified psutil to shutil since I feel it's a typo. Please revert back if it's incorrect. ---------- nosy: +giampaolo.rodola, tarek, xtreak title: psutil.disk_usage - Lacking documentation -> shutil.disk_usage - Lacking documentation _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38825> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Lord Anton Hvornum <anton.doxid@gmail.com> added the comment: xtreak: You are correct, that was a typo. My apologies. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38825> _______________________________________
participants (2)
-
Karthikeyan Singaravelan
-
Lord Anton Hvornum