[Python-checkins] [3.11] gh-83006: Document behavior of `shutil.disk_usage` for non-mounted filesystems on Unix (GH-107031) (#107048)

ambv webhook-mailer at python.org
Sat Jul 22 14:25:18 EDT 2023


https://github.com/python/cpython/commit/2895dbd0f661566829d6dc4eadabb46d0395fde9
commit: 2895dbd0f661566829d6dc4eadabb46d0395fde9
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: ambv <lukasz at langa.pl>
date: 2023-07-22T20:25:15+02:00
summary:

[3.11] gh-83006: Document behavior of `shutil.disk_usage` for non-mounted filesystems on Unix (GH-107031) (#107048)

(cherry picked from commit 6e5f2235f3754307292c7d8d3698958136b5e311)

Co-authored-by: Matthieu Caneill <matthieucan at users.noreply.github.com>

files:
A Misc/NEWS.d/next/Library/2023-07-22-15-51-33.gh-issue-83006.21zaCz.rst
M Doc/library/shutil.rst

diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst
index 26a5cd531fa14..dcf421f162b15 100644
--- a/Doc/library/shutil.rst
+++ b/Doc/library/shutil.rst
@@ -393,6 +393,12 @@ Directory and files operations
    total, used and free space, in bytes. *path* may be a file or a
    directory.
 
+   .. note::
+
+      On Unix filesystems, *path* must point to a path within a **mounted**
+      filesystem partition. On those platforms, CPython doesn't attempt to
+      retrieve disk usage information from non-mounted filesystems.
+
    .. versionadded:: 3.3
 
    .. versionchanged:: 3.8
diff --git a/Misc/NEWS.d/next/Library/2023-07-22-15-51-33.gh-issue-83006.21zaCz.rst b/Misc/NEWS.d/next/Library/2023-07-22-15-51-33.gh-issue-83006.21zaCz.rst
new file mode 100644
index 0000000000000..e64d186082843
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2023-07-22-15-51-33.gh-issue-83006.21zaCz.rst
@@ -0,0 +1,2 @@
+Document behavior of :func:`shutil.disk_usage` for non-mounted filesystems
+on Unix.



More information about the Python-checkins mailing list