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 /Misc/NEWS.d/next | |
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 'Misc/NEWS.d/next')
-rw-r--r-- | Misc/NEWS.d/next/Library/2018-06-14-17-53-30.bpo-33721.8i9_9A.rst | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2018-06-14-17-53-30.bpo-33721.8i9_9A.rst b/Misc/NEWS.d/next/Library/2018-06-14-17-53-30.bpo-33721.8i9_9A.rst new file mode 100644 index 0000000..987bf46 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-06-14-17-53-30.bpo-33721.8i9_9A.rst @@ -0,0 +1,12 @@ +:mod:`os.path` functions that return a boolean result like +:func:`~os.path.exists`, :func:`~os.path.lexists`, :func:`~os.path.isdir`, +:func:`~os.path.isfile`, :func:`~os.path.islink`, and :func:`~os.path.ismount`, +and :mod:`pathlib.Path` methods that return a boolean result like +:meth:`~pathlib.Path.exists()`, :meth:`~pathlib.Path.is_dir()`, +:meth:`~pathlib.Path.is_file()`, :meth:`~pathlib.Path.is_mount()`, +:meth:`~pathlib.Path.is_symlink()`, :meth:`~pathlib.Path.is_block_device()`, +:meth:`~pathlib.Path.is_char_device()`, :meth:`~pathlib.Path.is_fifo()`, +:meth:`~pathlib.Path.is_socket()` now return ``False`` instead of raising +:exc:`ValueError` or its subclasses :exc:`UnicodeEncodeError` and +:exc:`UnicodeDecodeError` for paths that contain characters or bytes +unrepresentable at the OS level. |