Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d79210a

Browse files
committed
#11490: EACCES can also mean command not found
1 parent 6b19e50 commit d79210a

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

Lib/test/test_subprocess.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,8 @@ def test_leaking_fds_on_error(self):
554554
stderr=subprocess.PIPE)
555555
# Windows raises IOError
556556
except (IOError, OSError) as err:
557-
if err.errno != errno.ENOENT: # ignore "no such file"
557+
# ignore errors that indicate the command was not found
558+
if err.errno not in (errno.ENOENT, errno.EACCES):
558559
raise
559560

560561
def test_issue8780(self):

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ Build
221221
Tests
222222
-----
223223

224+
- Issue #11490: test_subprocess:test_leaking_fds_on_error no longer gives a
225+
false positive if the last directory in the path is inaccessible.
226+
224227
- Issue #10822: Fix test_posix:test_getgroups failure under Solaris. Patch
225228
by Ross Lagerwall.
226229

0 commit comments

Comments
 (0)