From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 15 Jan 2018 05:44:49 +0000 (-0800) Subject: bpo-15221: Update os.path.is*() documentation (GH-5185) (GH-5186) X-Git-Tag: v3.6.5rc1~158 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb80645d06c16461b0b58d8983cd7fa6962ba3c6;p=thirdparty%2FPython%2Fcpython.git bpo-15221: Update os.path.is*() documentation (GH-5185) (GH-5186) `os.path.is*()` can return False if the file can't be accessed. The behaviour is documented in details in `os.path.exists()`. Link to `os.path.exists()` from `os.path.is*()`. (cherry picked from commit b3dd18d4035803b50c65a434955966d1b3b1f363) --- diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst index 406054e5d7a3..06493f9505d3 100644 --- a/Doc/library/os.path.rst +++ b/Doc/library/os.path.rst @@ -246,8 +246,9 @@ the :mod:`glob` module.) .. function:: isfile(path) - Return ``True`` if *path* is an existing regular file. This follows symbolic - links, so both :func:`islink` and :func:`isfile` can be true for the same path. + Return ``True`` if *path* is an :func:`existing ` regular file. + This follows symbolic links, so both :func:`islink` and :func:`isfile` can + be true for the same path. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -255,8 +256,9 @@ the :mod:`glob` module.) .. function:: isdir(path) - Return ``True`` if *path* is an existing directory. This follows symbolic - links, so both :func:`islink` and :func:`isdir` can be true for the same path. + Return ``True`` if *path* is an :func:`existing ` directory. This + follows symbolic links, so both :func:`islink` and :func:`isdir` can be true + for the same path. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -264,8 +266,9 @@ the :mod:`glob` module.) .. function:: islink(path) - Return ``True`` if *path* refers to a directory entry that is a symbolic link. - Always ``False`` if symbolic links are not supported by the Python runtime. + Return ``True`` if *path* refers to an :func:`existing ` directory + entry that is a symbolic link. Always ``False`` if symbolic links are not + supported by the Python runtime. .. versionchanged:: 3.6 Accepts a :term:`path-like object`.