]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41737: expand doc for NotADirectoryError (GH-27471)
authorandrei kulakov <andrei.avk@gmail.com>
Tue, 3 Aug 2021 11:28:09 +0000 (07:28 -0400)
committerGitHub <noreply@github.com>
Tue, 3 Aug 2021 11:28:09 +0000 (13:28 +0200)
Doc/library/exceptions.rst

index 0a5037a4b2106972d4ddcfa1ba85989908dae36c..669979f7c5d5d921939c6dbaa08ec4e49022f1fa 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