Skip to content

Commit bb80645

Browse files
miss-islingtonMariatta
authored andcommitted
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 b3dd18d)
1 parent cf4cd4b commit bb80645

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
@@ -246,26 +246,29 @@ the :mod:`glob` module.)
246246

247247
.. function:: isfile(path)
248248

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

252253
.. versionchanged:: 3.6
253254
Accepts a :term:`path-like object`.
254255

255256

256257
.. function:: isdir(path)
257258

258-
Return ``True`` if *path* is an existing directory. This follows symbolic
259-
links, so both :func:`islink` and :func:`isdir` can be true for the same path.
259+
Return ``True`` if *path* is an :func:`existing <exists>` directory. This
260+
follows symbolic links, so both :func:`islink` and :func:`isdir` can be true
261+
for the same path.
260262

261263
.. versionchanged:: 3.6
262264
Accepts a :term:`path-like object`.
263265

264266

265267
.. function:: islink(path)
266268

267-
Return ``True`` if *path* refers to a directory entry that is a symbolic link.
268-
Always ``False`` if symbolic links are not supported by the Python runtime.
269+
Return ``True`` if *path* refers to an :func:`existing <exists>` directory
270+
entry that is a symbolic link. Always ``False`` if symbolic links are not
271+
supported by the Python runtime.
269272

270273
.. versionchanged:: 3.6
271274
Accepts a :term:`path-like object`.

0 commit comments

Comments
 (0)