Skip to content
Myr

Popen() list-arg pager process without shell=True

Before adoption: this commit came in with the history the project adopted, so no landing records it.

When the first argument to subprocess.Popen is a list, setting shell=True causes elements of the list to be discarded on POSIX platforms. Setting shell=False (the default) causes Popen() to invoke the first argument of the list and pass the rest of the arguments using "os.execvpe()-like behavior to execute the child program", per the subprocess docs at * https://docs.python.org/3/library/subprocess.html

authored by Roland Walker · committed by Roland Walker · parent 2a0e3ba · Browse files · 2 files+2 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+2 added−1 removed

  • other:+2 added−1 removed

2 files+2 added−1 removed

modified:src/click/_termui_impl.py+1 added-1 removed
448 unmodified lines
449 color = True450451 c = subprocess.Popen(452 [str(cmd_path)] + cmd_params,453 shell=True,453 shell=False,454 stdin=subprocess.PIPE,455 env=env,456 errors="replace",457 text=True,
390 unmodified lines
modified:CHANGES.rst+1 added
23 unmodified lines
24- Lazily import ``shutil``. :pr:`3023`25- Properly forward exception information to resources registered with26 ``click.core.Context.with_resource()``. :issue:`2447` :pr:`3058`27- Fix regression related to EOF handling in CliRunner. :issue:`2939`:pr:`2940`28- Don't discard pager arguments. :issue:`3039` :pr:`3055`2930Version 8.2.231-------------32
1262 unmodified lines