Skip to content

Commit 468314c

Browse files
gh-82849: revise intro to os.path.rst (GH-32232)
* revise the first paragraph of docs for os.path * add a mention of `os.PathLike` protocol * remove warnings rendered irrelevant by :pep:`383` and :pep:`529` Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
1 parent a861756 commit 468314c

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

Doc/library/os.path.rst

+4-11
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,10 @@
1111

1212
--------------
1313

14-
This module implements some useful functions on pathnames. To read or
15-
write files see :func:`open`, and for accessing the filesystem see the
16-
:mod:`os` module. The path parameters can be passed as either strings,
17-
or bytes. Applications are encouraged to represent file names as
18-
(Unicode) character strings. Unfortunately, some file names may not be
19-
representable as strings on Unix, so applications that need to support
20-
arbitrary file names on Unix should use bytes objects to represent
21-
path names. Vice versa, using bytes objects cannot represent all file
22-
names on Windows (in the standard ``mbcs`` encoding), hence Windows
23-
applications should use string objects to access all files.
14+
This module implements some useful functions on pathnames. To read or write
15+
files see :func:`open`, and for accessing the filesystem see the :mod:`os`
16+
module. The path parameters can be passed as strings, or bytes, or any object
17+
implementing the :class:`os.PathLike` protocol.
2418

2519
Unlike a unix shell, Python does not do any *automatic* path expansions.
2620
Functions such as :func:`expanduser` and :func:`expandvars` can be invoked
@@ -38,7 +32,6 @@ the :mod:`glob` module.)
3832
their parameters. The result is an object of the same type, if a path or
3933
file name is returned.
4034

41-
4235
.. note::
4336

4437
Since different operating systems have different path name conventions, there
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Update the introduction to documentation for :mod:`os.path` to remove
2+
warnings that became irrelevant after the implementations of :pep:`383` and
3+
:pep:`529`.

0 commit comments

Comments
 (0)