Skip to content

Commit 2a9f709

Browse files
bpo-41410: Fix outdated info in mkstemp docs (GH-21701)
Automerge-Triggered-By: @ericvsmith (cherry picked from commit e55de68) Co-authored-by: Rishav Kundu <rk@rishav.io>
1 parent e05f20b commit 2a9f709

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

Doc/library/tempfile.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,8 @@ The module defines the following user-callable items:
175175
If you want to force a bytes return value with otherwise default behavior,
176176
pass ``suffix=b''``.
177177

178-
If *text* is specified, it indicates whether to open the file in binary
179-
mode (the default) or text mode. On some platforms, this makes no
180-
difference.
178+
If *text* is specified and true, the file is opened in text mode.
179+
Otherwise, (the default) the file is opened in binary mode.
181180

182181
:func:`mkstemp` returns a tuple containing an OS-level handle to an open
183182
file (as would be returned by :func:`os.open`) and the absolute pathname

Lib/tempfile.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,7 @@ def mkstemp(suffix=None, prefix=None, dir=None, text=False):
307307
otherwise a default directory is used.
308308
309309
If 'text' is specified and true, the file is opened in text
310-
mode. Else (the default) the file is opened in binary mode. On
311-
some operating systems, this makes no difference.
310+
mode. Else (the default) the file is opened in binary mode.
312311
313312
If any of 'suffix', 'prefix' and 'dir' are not None, they must be the
314313
same type. If they are bytes, the returned name will be bytes; str

0 commit comments

Comments
 (0)