mirror of
https://github.com/python/cpython
synced 2026-09-28 01:13:17 +03:00
gh-88569: add ntpath.isreserved() (#95486)
Add `ntpath.isreserved()`, which identifies reserved pathnames such as "NUL", "AUX" and "CON". Deprecate `pathlib.PurePath.is_reserved()`. --------- Co-authored-by: Eryk Sun <eryksun@gmail.com> Co-authored-by: Brett Cannon <brett@python.org> Co-authored-by: Steve Dower <steve.dower@microsoft.com>
This commit is contained in:
parent
6c2b419fb9
commit
7e31d6dea2
8 changed files with 154 additions and 72 deletions
|
|
@ -321,6 +321,9 @@ os
|
|||
os.path
|
||||
-------
|
||||
|
||||
* Add :func:`os.path.isreserved` to check if a path is reserved on the current
|
||||
system. This function is only available on Windows.
|
||||
(Contributed by Barney Gale in :gh:`88569`.)
|
||||
* On Windows, :func:`os.path.isabs` no longer considers paths starting with
|
||||
exactly one (back)slash to be absolute.
|
||||
(Contributed by Barney Gale and Jon Foster in :gh:`44626`.)
|
||||
|
|
@ -498,6 +501,12 @@ Deprecated
|
|||
security and functionality bugs. This includes removal of the ``--cgi``
|
||||
flag to the ``python -m http.server`` command line in 3.15.
|
||||
|
||||
* :mod:`pathlib`:
|
||||
|
||||
* :meth:`pathlib.PurePath.is_reserved` is deprecated and scheduled for
|
||||
removal in Python 3.15. Use :func:`os.path.isreserved` to detect reserved
|
||||
paths on Windows.
|
||||
|
||||
* :mod:`sys`: :func:`sys._enablelegacywindowsfsencoding` function.
|
||||
Replace it with :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment variable.
|
||||
(Contributed by Inada Naoki in :gh:`73427`.)
|
||||
|
|
@ -709,6 +718,12 @@ Pending Removal in Python 3.15
|
|||
:func:`locale.getlocale()` instead.
|
||||
(Contributed by Hugo van Kemenade in :gh:`111187`.)
|
||||
|
||||
* :mod:`pathlib`:
|
||||
|
||||
* :meth:`pathlib.PurePath.is_reserved` is deprecated and scheduled for
|
||||
removal in Python 3.15. Use :func:`os.path.isreserved` to detect reserved
|
||||
paths on Windows.
|
||||
|
||||
* :class:`typing.NamedTuple`:
|
||||
|
||||
* The undocumented keyword argument syntax for creating NamedTuple classes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue