]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41737: expand doc for NotADirectoryError (GH-27471)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 3 Aug 2021 12:05:04 +0000 (05:05 -0700)
committerGitHub <noreply@github.com>
Tue, 3 Aug 2021 12:05:04 +0000 (05:05 -0700)
(cherry picked from commit f7c23a99cd4f8179b6ba2cffaeb78b852c0f6488)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
Doc/library/exceptions.rst

index d5d81dfd9e6382934bb3f67d4b90d0d393508abd..0e606360efae171b5cdf58ffd997eb8052c15b56 100644 (file)
@@ -690,8 +690,10 @@ depending on the system error code.
 
 .. exception:: NotADirectoryError
 
-   Raised when a directory operation (such as :func:`os.listdir`) is requested
-   on something which is not a directory.
+   Raised when a directory operation (such as :func:`os.listdir`) is requested on
+   something which is not a directory.  On most POSIX platforms, it may also be
+   raised if an operation attempts to open or traverse a non-directory file as if
+   it were a directory.
    Corresponds to :c:data:`errno` ``ENOTDIR``.
 
 .. exception:: PermissionError