From 944450c5963d1e871c2e2161f539100676cf6099 Mon Sep 17 00:00:00 2001 From: Benjamin Kane Date: Tue, 4 Aug 2020 11:00:38 -0700 Subject: [PATCH 1/3] Update `open()` docs with link to File Tutorial Adds a link to the "Reading and Writing Files" page so users can more easily discover how file handles are handled with the `with` context manager vs without it. --- Doc/library/functions.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 3c36b59befab91..5a538a786186d6 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1055,7 +1055,8 @@ are always available. They are listed here in alphabetical order. .. function:: open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None) Open *file* and return a corresponding :term:`file object`. If the file - cannot be opened, an :exc:`OSError` is raised. + cannot be opened, an :exc:`OSError` is raised. See + :ref:`tut-files` for file handle details. *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 From 3a535cdaaeb7db02a4376ca7ce83e42907ca5bfb Mon Sep 17 00:00:00 2001 From: Benjamin Kane Date: Wed, 5 Aug 2020 09:09:35 -0700 Subject: [PATCH 2/3] change file handle to file object --- Doc/library/functions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 5a538a786186d6..42cbc1fb07b154 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1056,7 +1056,7 @@ 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. See - :ref:`tut-files` for file handle details. + :ref:`tut-files` for file object details. *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 From 2645037fc85a3ca058e66ea7982c9ddf33ea119d Mon Sep 17 00:00:00 2001 From: Benjamin Kane Date: Fri, 7 Aug 2020 12:06:05 -0700 Subject: [PATCH 3/3] open() docs: file object details -> more examples --- Doc/library/functions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 42cbc1fb07b154..43c47c1da9434c 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1056,7 +1056,7 @@ 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. See - :ref:`tut-files` for file object details. + :ref:`tut-files` for more examples of how to use this function. *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