From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sat, 22 Jul 2023 18:25:03 +0000 (-0700) Subject: [3.12] gh-83006: Document behavior of `shutil.disk_usage` for non-mounted filesystems... X-Git-Tag: v3.12.0rc1~109 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0fff068181d1ad69907c06c1e0b30d5467a80f39;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-83006: Document behavior of `shutil.disk_usage` for non-mounted filesystems on Unix (GH-107031) (#107047) (cherry picked from commit 6e5f2235f3754307292c7d8d3698958136b5e311) Co-authored-by: Matthieu Caneill --- diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index 5bd80b10a658..7699d22a72aa 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:: + + 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 000000000000..e64d18608284 --- /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.