]> granicus.if.org Git - python/commitdiff
#11490: EACCES can also mean command not found
authorR David Murray <rdmurray@bitdance.com>
Mon, 14 Mar 2011 02:37:18 +0000 (22:37 -0400)
committerR David Murray <rdmurray@bitdance.com>
Mon, 14 Mar 2011 02:37:18 +0000 (22:37 -0400)
Lib/test/test_subprocess.py
Misc/NEWS

index 37dc245ebead98b539baf5f516a5dfa748fb2912..04eb9b14fff56a212a0533fd69ea54ead3d90064 100644 (file)
@@ -573,7 +573,8 @@ class ProcessTestCase(BaseTestCase):
                 subprocess.Popen(['nonexisting_i_hope'],
                                  stdout=subprocess.PIPE,
                                  stderr=subprocess.PIPE)
-            if c.exception.errno != errno.ENOENT:  # ignore "no such file"
+            # ignore errors that indicate the command was not found
+            if c.exception.errno not in (errno.ENOENT, errno.EACCES):
                 raise c.exception
 
     def test_handles_closed_on_exception(self):
index c3117cbcad0e1f8a30332016bcaf5e25a72552f3..2b52138f2f5dcd727ad88ba6bc60aa4d54d3d3f2 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -251,6 +251,9 @@ Build
 Tests
 -----
 
+- Issue #11490: test_subprocess:test_leaking_fds_on_error no longer gives a
+  false positive if the last directory in the path is inaccessible.
+
 - Issue #10822: Fix test_posix:test_getgroups failure under Solaris.  Patch
   by Ross Lagerwall.