[Python-checkins] r86593 - in python/branches/py3k: Lib/subprocess.py Lib/test/test_subprocess.py Misc/ACKS Misc/NEWS

benjamin.peterson python-checkins at python.org
Sat Nov 20 19:07:52 CET 2010


Author: benjamin.peterson
Date: Sat Nov 20 19:07:52 2010
New Revision: 86593

Log:
add filename to ENOENT message #4925

Modified:
   python/branches/py3k/Lib/subprocess.py
   python/branches/py3k/Lib/test/test_subprocess.py
   python/branches/py3k/Misc/ACKS
   python/branches/py3k/Misc/NEWS

Modified: python/branches/py3k/Lib/subprocess.py
==============================================================================
--- python/branches/py3k/Lib/subprocess.py	(original)
+++ python/branches/py3k/Lib/subprocess.py	Sat Nov 20 19:07:52 2010
@@ -1255,6 +1255,8 @@
                     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)
 

Modified: python/branches/py3k/Lib/test/test_subprocess.py
==============================================================================
--- python/branches/py3k/Lib/test/test_subprocess.py	(original)
+++ python/branches/py3k/Lib/test/test_subprocess.py	Sat Nov 20 19:07:52 2010
@@ -666,6 +666,7 @@
             # 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)

Modified: python/branches/py3k/Misc/ACKS
==============================================================================
--- python/branches/py3k/Misc/ACKS	(original)
+++ python/branches/py3k/Misc/ACKS	Sat Nov 20 19:07:52 2010
@@ -726,6 +726,7 @@
 Mark Sapiro
 Ty Sarna
 Ben Sayer
+Andrew Schaaf
 Michael Scharf
 Andreas Schawo
 Neil Schemenauer

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Sat Nov 20 19:07:52 2010
@@ -10,6 +10,9 @@
 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.
 


More information about the Python-checkins mailing list