Skip to content

Commit b3dd18d

Browse files
csabellaMariatta
authored andcommitted
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*()`.
1 parent 3329992 commit b3dd18d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Doc/library/os.path.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,26 +240,29 @@ the :mod:`glob` module.)
240240

241241
.. function:: isfile(path)
242242

243-
Return ``True`` if *path* is an existing regular file. This follows symbolic
244-
links, so both :func:`islink` and :func:`isfile` can be true for the same path.
243+
Return ``True`` if *path* is an :func:`existing <exists>` regular file.
244+
This follows symbolic links, so both :func:`islink` and :func:`isfile` can
245+
be true for the same path.
245246

246247
.. versionchanged:: 3.6
247248
Accepts a :term:`path-like object`.
248249

249250

250251
.. function:: isdir(path)
251252

252-
Return ``True`` if *path* is an existing directory. This follows symbolic
253-
links, so both :func:`islink` and :func:`isdir` can be true for the same path.
253+
Return ``True`` if *path* is an :func:`existing <exists>` directory. This
254+
follows symbolic links, so both :func:`islink` and :func:`isdir` can be true
255+
for the same path.
254256

255257
.. versionchanged:: 3.6
256258
Accepts a :term:`path-like object`.
257259

258260

259261
.. function:: islink(path)
260262

261-
Return ``True`` if *path* refers to a directory entry that is a symbolic link.
262-
Always ``False`` if symbolic links are not supported by the Python runtime.
263+
Return ``True`` if *path* refers to an :func:`existing <exists>` directory
264+
entry that is a symbolic link. Always ``False`` if symbolic links are not
265+
supported by the Python runtime.
263266

264267
.. versionchanged:: 3.6
265268
Accepts a :term:`path-like object`.

0 commit comments

Comments
 (0)