]> granicus.if.org Git - python/commitdiff
add filename to ENOENT message #4925
authorBenjamin Peterson <benjamin@python.org>
Sat, 20 Nov 2010 18:07:52 +0000 (18:07 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sat, 20 Nov 2010 18:07:52 +0000 (18:07 +0000)
Lib/subprocess.py
Lib/test/test_subprocess.py
Misc/ACKS
Misc/NEWS

index d699ed07ce18a9df36cbfa97cd0114cb4ccbe6ba..b40d2a8a2e68bfb5ddc30b65597769a3f811b346 100644 (file)
@@ -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)
 
index 1a9fb695168e0c029b7454c16f400ebb741c23c0..f8ecb4d54316c9566a61c79ed0aa96b8957db7c6 100644 (file)
@@ -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)
index 9c003e988eba050ce3f5d24853f3f5f679fa8287..d61f9534794e4908895582107d0cb8cc2daa9200 100644 (file)
--- 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
index 693f4e6a94b834889a99a1125af6313dd6046618..da26317d173799d35967b59bc072ef6da6c606ec 100644 (file)
--- 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.