bpo-15221: Update os.path.is*() documentation (GH-5185)

`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*()`.
This commit is contained in:
Cheryl Sabella 2018-01-14 23:57:51 -05:00 committed by Mariatta
parent 3329992e31
commit b3dd18d403
1 changed files with 9 additions and 6 deletions

View File

@ -240,8 +240,9 @@ the :mod:`glob` module.)
.. function:: isfile(path) .. function:: isfile(path)
Return ``True`` if *path* is an existing regular file. This follows symbolic Return ``True`` if *path* is an :func:`existing <exists>` regular file.
links, so both :func:`islink` and :func:`isfile` can be true for the same path. This follows symbolic links, so both :func:`islink` and :func:`isfile` can
be true for the same path.
.. versionchanged:: 3.6 .. versionchanged:: 3.6
Accepts a :term:`path-like object`. Accepts a :term:`path-like object`.
@ -249,8 +250,9 @@ the :mod:`glob` module.)
.. function:: isdir(path) .. function:: isdir(path)
Return ``True`` if *path* is an existing directory. This follows symbolic Return ``True`` if *path* is an :func:`existing <exists>` directory. This
links, so both :func:`islink` and :func:`isdir` can be true for the same path. follows symbolic links, so both :func:`islink` and :func:`isdir` can be true
for the same path.
.. versionchanged:: 3.6 .. versionchanged:: 3.6
Accepts a :term:`path-like object`. Accepts a :term:`path-like object`.
@ -258,8 +260,9 @@ the :mod:`glob` module.)
.. function:: islink(path) .. function:: islink(path)
Return ``True`` if *path* refers to a directory entry that is a symbolic link. Return ``True`` if *path* refers to an :func:`existing <exists>` directory
Always ``False`` if symbolic links are not supported by the Python runtime. entry that is a symbolic link. Always ``False`` if symbolic links are not
supported by the Python runtime.
.. versionchanged:: 3.6 .. versionchanged:: 3.6
Accepts a :term:`path-like object`. Accepts a :term:`path-like object`.