I don’t know enough about all the different combinations and possibilities here (especially Windows) but how about this as a suggestion:
- Deprecate (in the soft sense) any use of
runexcept for with a list of strings and withshell=Falseand also deprecate the shell parameter. - Add a new function
shrunwhose argument must be a t-string.
The intended usage is then:
def run(cmd: list[str], ...):
"""Launch subprocess"""
...
def shrun(cmd: Template, ...):
"""Run command in shell with interpolation"""
...
Then the suggestion is that anyone doing
run(f'echo {name}', shell=True)
should do
shrun(t'echo {name}')