mirror of https://github.com/python/cpython
Issue #8513: On UNIX, subprocess supports bytes command string.
This commit is contained in:
parent
8370bb9528
commit
7b3b20ad29
|
@ -1125,7 +1125,7 @@ class Popen(object):
|
||||||
restore_signals, start_new_session):
|
restore_signals, start_new_session):
|
||||||
"""Execute program (POSIX version)"""
|
"""Execute program (POSIX version)"""
|
||||||
|
|
||||||
if isinstance(args, str):
|
if isinstance(args, (str, bytes)):
|
||||||
args = [args]
|
args = [args]
|
||||||
else:
|
else:
|
||||||
args = list(args)
|
args = list(args)
|
||||||
|
|
|
@ -1059,6 +1059,11 @@ class POSIXProcessTestCase(BaseTestCase):
|
||||||
exitcode = subprocess.call([abs_program, "-c", "pass"])
|
exitcode = subprocess.call([abs_program, "-c", "pass"])
|
||||||
self.assertEqual(exitcode, 0)
|
self.assertEqual(exitcode, 0)
|
||||||
|
|
||||||
|
# absolute bytes path as a string
|
||||||
|
cmd = b"'" + abs_program + b"' -c pass"
|
||||||
|
exitcode = subprocess.call(cmd, shell=True)
|
||||||
|
self.assertEqual(exitcode, 0)
|
||||||
|
|
||||||
# bytes program, unicode PATH
|
# bytes program, unicode PATH
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env["PATH"] = path
|
env["PATH"] = path
|
||||||
|
|
|
@ -52,6 +52,8 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #8513: On UNIX, subprocess supports bytes command string.
|
||||||
|
|
||||||
- Issue #10866: Add socket.sethostname(). Initial patch by Ross Lagerwall.
|
- Issue #10866: Add socket.sethostname(). Initial patch by Ross Lagerwall.
|
||||||
|
|
||||||
- Issue #11140: Lock.release() now raises a RuntimeError when attempting
|
- Issue #11140: Lock.release() now raises a RuntimeError when attempting
|
||||||
|
|
Loading…
Reference in New Issue