summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/subprocess.py2
-rw-r--r--Lib/test/test_subprocess.py1
-rw-r--r--Misc/ACKS1
-rw-r--r--Misc/NEWS3
4 files changed, 7 insertions, 0 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index d699ed0..b40d2a8 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1255,6 +1255,8 @@ class Popen(object):
errno = int(hex_errno, 16)
if errno != 0:
err_msg = os.strerror(errno)
+ if errno == errno.ENOENT:
+ err_msg += ': ' + repr(args[0])
raise child_exception_type(errno, err_msg)
raise child_exception_type(err_msg)
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 1a9fb69..f8ecb4d 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -666,6 +666,7 @@ class POSIXProcessTestCase(BaseTestCase):
# string and instead capture the exception that we want to see
# below for comparison.
desired_exception = e
+ desired_exception.strerror += ': ' + repr(sys.executable)
else:
self.fail("chdir to nonexistant directory %s succeeded." %
nonexistent_dir)
diff --git a/Misc/ACKS b/Misc/ACKS
index 9c003e9..d61f953 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -726,6 +726,7 @@ Ilya Sandler
Mark Sapiro
Ty Sarna
Ben Sayer
+Andrew Schaaf
Michael Scharf
Andreas Schawo
Neil Schemenauer
diff --git a/Misc/NEWS b/Misc/NEWS
index 693f4e6..da26317 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ What's New in Python 3.2 Beta 1?
Core and Builtins
-----------------
+- Issue #4925: Add filename to error message when executable can't be found in
+ subprocess.
+
- Issue #1574217: isinstance now catches only AttributeError, rather than
masking all errors.