Commit 5f780400 authored by Benjamin Peterson's avatar Benjamin Peterson

add filename to ENOENT message #4925

parent c610e3e5
...@@ -1255,6 +1255,8 @@ class Popen(object): ...@@ -1255,6 +1255,8 @@ class Popen(object):
errno = int(hex_errno, 16) errno = int(hex_errno, 16)
if errno != 0: if errno != 0:
err_msg = os.strerror(errno) 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(errno, err_msg)
raise child_exception_type(err_msg) raise child_exception_type(err_msg)
......
...@@ -666,6 +666,7 @@ class POSIXProcessTestCase(BaseTestCase): ...@@ -666,6 +666,7 @@ class POSIXProcessTestCase(BaseTestCase):
# string and instead capture the exception that we want to see # string and instead capture the exception that we want to see
# below for comparison. # below for comparison.
desired_exception = e desired_exception = e
desired_exception.strerror += ': ' + repr(sys.executable)
else: else:
self.fail("chdir to nonexistant directory %s succeeded." % self.fail("chdir to nonexistant directory %s succeeded." %
nonexistent_dir) nonexistent_dir)
......
...@@ -726,6 +726,7 @@ Ilya Sandler ...@@ -726,6 +726,7 @@ Ilya Sandler
Mark Sapiro Mark Sapiro
Ty Sarna Ty Sarna
Ben Sayer Ben Sayer
Andrew Schaaf
Michael Scharf Michael Scharf
Andreas Schawo Andreas Schawo
Neil Schemenauer Neil Schemenauer
......
...@@ -10,6 +10,9 @@ What's New in Python 3.2 Beta 1? ...@@ -10,6 +10,9 @@ What's New in Python 3.2 Beta 1?
Core and Builtins 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 - Issue #1574217: isinstance now catches only AttributeError, rather than
masking all errors. masking all errors.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment