summaryrefslogtreecommitdiffstats
path: root/Doc/library/functions.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r--Doc/library/functions.rst13
1 files changed, 8 insertions, 5 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index efa5bd3..7216f1d 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -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 or bytes 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 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``.)
*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.
@@ -1077,6 +1077,9 @@ are always available. They are listed here in alphabetical order.
.. versionchanged:: 3.5
The ``'namereplace'`` error handler was added.
+ .. versionchanged:: 3.6
+ Support added to accept objects implementing :class:`os.PathLike`.
+
.. function:: ord(c)
Given a string representing one Unicode character, return an integer