From 0f26bc70e1072a7e145e5805229e2184ac08501d Mon Sep 17 00:00:00 2001 From: Matthieu Caneill Date: Sat, 22 Jul 2023 15:51:41 +0200 Subject: [PATCH 1/2] Document behavior of `shutil.disk_usage` for non-mounted filesystems on Unix --- Doc/library/shutil.rst | 6 ++++++ .../Library/2023-07-22-15-51-33.gh-issue-83006.21zaCz.rst | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2023-07-22-15-51-33.gh-issue-83006.21zaCz.rst diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index 5bd80b10a65806..42f1bbe8865c24 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -399,6 +399,12 @@ Directory and files operations total, used and free space, in bytes. *path* may be a file or a directory. + .. note:: + + Where applicable (e.g. Unix), *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 00000000000000..e64d1860828430 --- /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. From f6121bce330527f3e88516954eddda3137ed300a Mon Sep 17 00:00:00 2001 From: Matthieu Caneill Date: Sat, 22 Jul 2023 16:07:15 +0200 Subject: [PATCH 2/2] Improve phrasing --- Doc/library/shutil.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index 42f1bbe8865c24..7699d22a72aaff 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -401,9 +401,9 @@ Directory and files operations .. note:: - Where applicable (e.g. Unix), *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. + 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