diff -up release26-maint/Lib/os.py.orig release26-maint/Lib/os.py --- release26-maint/Lib/os.py.orig 2008-10-23 04:27:36.000000000 +0300 +++ release26-maint/Lib/os.py 2009-02-20 10:46:44.000000000 +0200 @@ -668,9 +668,11 @@ if _exists("fork"): msg = "os.popen2 is deprecated. Use the subprocess module." warnings.warn(msg, DeprecationWarning, stacklevel=2) + use_shell = isinstance(cmd, str) + import subprocess PIPE = subprocess.PIPE - p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, + p = subprocess.Popen(cmd, shell=use_shell, bufsize=bufsize, stdin=PIPE, stdout=PIPE, close_fds=True) return p.stdin, p.stdout __all__.append("popen2") @@ -687,9 +689,11 @@ if _exists("fork"): msg = "os.popen3 is deprecated. Use the subprocess module." warnings.warn(msg, DeprecationWarning, stacklevel=2) + use_shell = isinstance(cmd, str) + import subprocess PIPE = subprocess.PIPE - p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, + p = subprocess.Popen(cmd, shell=use_shell, bufsize=bufsize, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True) return p.stdin, p.stdout, p.stderr @@ -707,9 +711,11 @@ if _exists("fork"): msg = "os.popen4 is deprecated. Use the subprocess module." warnings.warn(msg, DeprecationWarning, stacklevel=2) + use_shell = isinstance(cmd, str) + import subprocess PIPE = subprocess.PIPE - p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, + p = subprocess.Popen(cmd, shell=use_shell, bufsize=bufsize, stdin=PIPE, stdout=PIPE, stderr=subprocess.STDOUT, close_fds=True) return p.stdin, p.stdout