Issue #26027, #27524: Document the support for path-like objects in os and os.path.

This completes PEP 519.
This commit is contained in:
Brett Cannon 2016-09-06 15:55:02 -07:00
parent ec6ce879c7
commit 6fa7aada9b
3 changed files with 233 additions and 22 deletions

View file

@ -878,11 +878,11 @@ are always available. They are listed here in alphabetical order.
Open *file* and return a corresponding :term:`file object`. If the file
cannot be opened, an :exc:`OSError` is raised.
*file* is either a string, bytes, or :class:`os.PathLike` object giving the
pathname (absolute or relative to the current working directory) of the file
to be opened or an integer file descriptor of the file to be wrapped. (If a
file descriptor is given, it is closed when the returned I/O object is
closed, unless *closefd* is set to ``False``.)
*file* is a :term:`path-like object` giving the pathname (absolute or
relative to the current working directory) of the file to be opened or an
integer file descriptor of the file to be wrapped. (If a file descriptor is
given, it is closed when the returned I/O object is closed, unless *closefd*
is set to ``False``.)
*mode* is an optional string that specifies the mode in which the file is
opened. It defaults to ``'r'`` which means open for reading in text mode.