[Python-Dev] subprocess shell=True on Windows doesn't escape ^ character
Chris Angelico
rosuav at gmail.com
Fri Jun 13 04:25:36 CEST 2014
More information about the Python-Dev mailing list
Fri Jun 13 04:25:36 CEST 2014
- Previous message: [Python-Dev] subprocess shell=True on Windows doesn't escape ^ character
- Next message: [Python-Dev] subprocess shell=True on Windows doesn't escape ^ character
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, Jun 13, 2014 at 12:11 PM, Nikolaus Rath <Nikolaus at rath.org> wrote: > Can someone describe an use case where shell=True actually makes sense > at all? > > It seems to me that whenever you need a shell, the argument's that you > pass to it will be shell specific. So instead of e.g. > > Popen('for i in `seq 42`; do echo $i; done', shell=True) > > you almost certainly want to do > > Popen(['/bin/sh', 'for i in `seq 42`; do echo $i; done'], shell=False) > > because if your shell happens to be tcsh or cmd.exe, things are going to > break. Some features, while technically shell-specific, are supported across a lot of shells. You should be able to pipe output from one command into another in most shells, for instance. But yes, I generally don't use it. ChrisA
- Previous message: [Python-Dev] subprocess shell=True on Windows doesn't escape ^ character
- Next message: [Python-Dev] subprocess shell=True on Windows doesn't escape ^ character
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list