Skip to content

Commit bf3a3f7

Browse files
committed
Copy description of 'strict' from pathlib.
1 parent 047471c commit bf3a3f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Doc/library/os.path.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,9 @@ the :mod:`glob` module.)
350350
links encountered in the path (if they are supported by the operating
351351
system).
352352

353-
In non-strict mode (the default), missing or inaccessible ancestors are
354-
permitted; when encountered, the remainder of the path joined on and
355-
returned. In strict mode an :exc:`OSError` is raised in this scenario.
353+
If the path doesn't exist and *strict* is ``True``, :exc:`FileNotFoundError`
354+
is raised. If *strict* is ``False``, the path is resolved as far as possible
355+
and any remainder is appended without checking whether it exists.
356356

357357
.. versionchanged:: 3.6
358358
Accepts a :term:`path-like object`.

0 commit comments

Comments
 (0)