Message171850
The error message in the FileNotFoundError error raised by subprocess.Popen() displays the wrong path when the bad path is due to the executable argument rather than args. The message gives the path for args[0] rather than for the executable argument.
For example, this--
import subprocess, sys
python_path = sys.executable
p = subprocess.Popen([python_path, "-c", "import sys; sys.exit(1)"])
p.wait()
p = subprocess.Popen([python_path, "-c", "import sys; sys.exit(1)"],
executable="foo")
p.wait()
gives--
Traceback (most recent call last):
File "test-subprocess.py", line 6, in <module>
executable="foo")
File ".../Lib/subprocess.py", line 818, in __init__
restore_signals, start_new_session)
File ".../Lib/subprocess.py", line 1416, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '.../python.exe'
The path in the last line should read "foo" since '.../python.exe' is obviously found as evidenced from the previous Popen() invocation. |
|
Date |
User |
Action |
Args |
2012-10-03 04:16:47 | chris.jerdonek | set | recipients:
+ chris.jerdonek, asvetlov |
2012-10-03 04:16:47 | chris.jerdonek | set | messageid: <1349237807.22.0.592724343556.issue16114@psf.upfronthosting.co.za> |
2012-10-03 04:16:47 | chris.jerdonek | link | issue16114 messages |
2012-10-03 04:16:46 | chris.jerdonek | create | |
|