[Tutor] Does python change subprocess based on whether it is run in the interactive shell or not

Dennis Lee Bieber wlfraed at ix.netcom.com
Sat Oct 29 13:54:29 EDT 2022


On Sat, 29 Oct 2022 14:23:56 +0100, Alan Gauld via Tutor <tutor at python.org>
declaimed the following:

>
>Probably not. shell=True simply says to read the command
>in a shell environment expanding wildcards etc. You don't seem
>to be using anything that needs shell expansion.

	Documentation is a bit confusing...

"""
Changed in version 3.6: args parameter accepts a path-like object if shell
is False and a sequence containing path-like objects on POSIX.

Changed in version 3.8: args parameter accepts a path-like object if shell
is False and a sequence containing bytes and path-like objects on Windows.

The shell argument (which defaults to False) specifies whether to use the
shell as the program to execute. If shell is True, it is recommended to
pass args as a string rather than as a sequence.
"""

	That "is False and a sequence" throws me? I want to read it as "or".

	The OP is specifying "cmd" as a string.


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed at ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/



More information about the Tutor mailing list