[Python-checkins] bpo-32667: Fix tests when $PATH contains a file (#5324)

Victor Stinner webhook-mailer at python.org
Thu Jan 25 16:41:41 EST 2018


https://github.com/python/cpython/commit/6996f284d4d90aa05c46d9fe6f38d1030454b224
commit: 6996f284d4d90aa05c46d9fe6f38d1030454b224
branch: 2.7
author: Victor Stinner <victor.stinner at gmail.com>
committer: GitHub <noreply at github.com>
date: 2018-01-25T22:41:38+01:00
summary:

bpo-32667: Fix tests when $PATH contains a file (#5324)

test_subprocess.test_leaking_fds_on_error() failed when the PATH
environment variable contains a path to an existing file. Fix the
test: ignore also ENOTDIR, not only ENOENT and EACCES.

files:
M Lib/test/test_subprocess.py

diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index a5a727efd62..ee2383b8a93 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -697,7 +697,7 @@ def test_leaking_fds_on_error(self):
                                  stdout=subprocess.PIPE,
                                  stderr=subprocess.PIPE)
             # ignore errors that indicate the command was not found
-            if c.exception.errno not in (errno.ENOENT, errno.EACCES):
+            if c.exception.errno not in (errno.ENOENT, errno.ENOTDIR, errno.EACCES):
                 raise c.exception
 
     @unittest.skipIf(threading is None, "threading required")



More information about the Python-checkins mailing list