@@ -39,7 +39,7 @@ compatibility with older versions, see the :ref:`call-function-trio` section.
39
39
40
40
.. function :: run(args, *, stdin=None, input=None, stdout=None, stderr=None,\
41
41
shell=False, cwd=None, timeout=None, check=False, \
42
- encoding=None, errors=None)
42
+ encoding=None, errors=None, text=None )
43
43
44
44
Run the command described by *args *. Wait for command to complete, then
45
45
return a :class: `CompletedProcess ` instance.
@@ -267,7 +267,8 @@ default values. The arguments that are most commonly needed are:
267
267
.. index ::
268
268
single: universal newlines; subprocess module
269
269
270
- If *encoding * or *errors * are specified, or *universal_newlines * is true,
270
+ If *encoding * or *errors * are specified, or *text * (also known as
271
+ *universal_newlines *) is true,
271
272
the file objects *stdin *, *stdout * and *stderr * will be opened in text
272
273
mode using the *encoding * and *errors * specified in the call or the
273
274
defaults for :class: `io.TextIOWrapper `.
@@ -284,6 +285,9 @@ default values. The arguments that are most commonly needed are:
284
285
.. versionadded :: 3.6
285
286
Added *encoding * and *errors * parameters.
286
287
288
+ .. versionadded :: 3.7
289
+ Added the *text * parameter as an alias for *universal_newlines *.
290
+
287
291
.. note ::
288
292
289
293
The newlines attribute of the file objects :attr: `Popen.stdin `,
@@ -328,7 +332,7 @@ functions.
328
332
cwd=None, env=None, universal_newlines=False, \
329
333
startupinfo=None, creationflags=0, restore_signals=True, \
330
334
start_new_session=False, pass_fds=(), *, \
331
- encoding=None, errors=None)
335
+ encoding=None, errors=None, text=None )
332
336
333
337
Execute a child program in a new process. On POSIX, the class uses
334
338
:meth: `os.execvp `-like behavior to execute the child program. On Windows,
@@ -511,15 +515,18 @@ functions.
511
515
512
516
.. _side-by-side assembly : https://en.wikipedia.org/wiki/Side-by-Side_Assembly
513
517
514
- If *encoding * or *errors * are specified, the file objects * stdin *, * stdout *
515
- and *stderr * are opened in text mode with the specified encoding and
516
- *errors *, as described above in :ref: `frequently-used-arguments `. If
517
- *universal_newlines * is `` True ``, they are opened in text mode with default
518
- encoding. Otherwise, they are opened as binary streams .
518
+ If *encoding * or *errors * are specified, or * text * is true, the file objects
519
+ * stdin *, * stdout * and *stderr * are opened in text mode with the specified
520
+ encoding and *errors *, as described above in :ref: `frequently-used-arguments `.
521
+ The *universal_newlines * argument is equivalent to * text * and is provided
522
+ for backwards compatibility. By default, file objects are opened in binary mode .
519
523
520
524
.. versionadded :: 3.6
521
525
*encoding * and *errors * were added.
522
526
527
+ .. versionadded :: 3.7
528
+ *text * was added as a more readable alias for *universal_newlines *.
529
+
523
530
If given, *startupinfo * will be a :class: `STARTUPINFO ` object, which is
524
531
passed to the underlying ``CreateProcess `` function.
525
532
*creationflags *, if given, can be one or more of the following flags:
0 commit comments