Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1346,15 +1346,16 @@
single: file object; open() built-in function

.. function:: open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)

`

Check warning on line 1349 in Doc/library/functions.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

Inline interpreted text or phrase reference start-string without end-string. [docutils]

Check warning on line 1349 in Doc/library/functions.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

Explicit markup ends without a blank line; unexpected unindent. [docutils]
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 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
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*
relative to the current working directory) of the file to be opened,
or an object with a ``name`` attribute, 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
Expand All @@ -1366,7 +1367,7 @@
*encoding* is not specified the encoding used is platform-dependent:
:func:`locale.getencoding` is called to get the current locale encoding.
(For reading and writing raw bytes use binary mode and leave
*encoding* unspecified.) The available modes are:
*encoding* unspecified.) The available modes are:`

.. _filemodes:

Expand Down
18 changes: 18 additions & 0 deletions tatus
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index cd819b8d06..cfa6d9620d 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -1352,9 +1352,10 @@ are always available. They are listed here in alphabetical order.
: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
- 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*
+ relative to the current working directory) of the file to be opened,
+ or an object with a ``name`` attribute, 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
Loading