]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Doc: Add a link to tutorial page from `open()` doc (GH-21737)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 8 Aug 2020 03:05:04 +0000 (20:05 -0700)
committerGitHub <noreply@github.com>
Sat, 8 Aug 2020 03:05:04 +0000 (20:05 -0700)
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.
(cherry picked from commit 705f14556545699ab615ec98f707b438f9603767)

Co-authored-by: Benjamin Kane <bbkane@users.noreply.github.com>
Doc/library/functions.rst

index 0f7df0e5e9107fde7f737b8c87cca8e62a85f5e9..8cf755a0e6b3809ca94932f24f37e2c91b88465c 100644 (file)
@@ -1035,7 +1035,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 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