diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-09-18 08:28:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-18 08:28:51 (GMT) |
commit | 0185f34ddcf07b78feb6ac666fbfd4615d26b028 (patch) | |
tree | a27f02f0095d5a7fb1fcbd539114b3a74fb4fcc7 /Doc/library/pathlib.rst | |
parent | 7bdf28265aa371b39f82dfc6562635801aff15a5 (diff) | |
download | cpython-0185f34ddcf07b78feb6ac666fbfd4615d26b028.zip cpython-0185f34ddcf07b78feb6ac666fbfd4615d26b028.tar.gz cpython-0185f34ddcf07b78feb6ac666fbfd4615d26b028.tar.bz2 |
bpo-33721: Make some os.path functions and pathlib.Path methods be tolerant to invalid paths. (#7695)
Such functions as os.path.exists(), os.path.lexists(), os.path.isdir(),
os.path.isfile(), os.path.islink(), and os.path.ismount() now return False
instead of raising ValueError or its subclasses UnicodeEncodeError
and UnicodeDecodeError for paths that contain characters or bytes
unrepresentative at the OS level.
Diffstat (limited to 'Doc/library/pathlib.rst')
-rw-r--r-- | Doc/library/pathlib.rst | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index ec604f6..fc19300 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -638,7 +638,17 @@ Methods Concrete paths provide the following methods in addition to pure paths methods. Many of these methods can raise an :exc:`OSError` if a system -call fails (for example because the path doesn't exist): +call fails (for example because the path doesn't exist). + +.. versionchanged:: 3.8 + + :meth:`~Path.exists()`, :meth:`~Path.is_dir()`, :meth:`~Path.is_file()`, + :meth:`~Path.is_mount()`, :meth:`~Path.is_symlink()`, + :meth:`~Path.is_block_device()`, :meth:`~Path.is_char_device()`, + :meth:`~Path.is_fifo()`, :meth:`~Path.is_socket()` now return ``False`` + instead of raising an exception for paths that contain characters + unrepresentable at the OS level. + .. classmethod:: Path.cwd() |