From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 3 Aug 2021 12:03:40 +0000 (-0700) Subject: bpo-41737: expand doc for NotADirectoryError (GH-27471) (GH-27577) X-Git-Tag: v3.9.7~87 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b5f026112768eb0a06622263bdea86d7d85981c5;p=thirdparty%2FPython%2Fcpython.git bpo-41737: expand doc for NotADirectoryError (GH-27471) (GH-27577) (cherry picked from commit f7c23a99cd4f8179b6ba2cffaeb78b852c0f6488) Co-authored-by: andrei kulakov --- diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst index 6bed5c70f0ad..85cd193f903b 100644 --- a/Doc/library/exceptions.rst +++ b/Doc/library/exceptions.rst @@ -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