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.
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index a5a727e..ee2383b 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -697,7 +697,7 @@
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")