A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-June/135057.html below:

[Python-Dev] subprocess shell=True on Windows doesn't escape ^ character

[Python-Dev] subprocess shell=True on Windows doesn't escape ^ character [Python-Dev] subprocess shell=True on Windows doesn't escape ^ characterGreg Ewing greg.ewing at canterbury.ac.nz
Fri Jun 13 06:57:49 CEST 2014
Nikolaus Rath wrote:
> 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.

On Unix, the C library's system() and popen() functions
always use /bin/sh, NOT the user's current login shell,
for this very reason.

I would hope that the Python versions of these, and also
the new subprocess stuff, do the same.

That still leaves differences between Unix and Windows,
but explicitly naming the shell won't help with that.

-- 
Greg
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4