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

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

index 6bed5c70f0ad0409926bcc0330cc56b058e9611f..85cd193f903b0f7c44cd435d27a7dc1fff0a2fc5 100644 (file)
@@ -659,8 +659,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