Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ce58dc7b
Commit
ce58dc7b
authored
Feb 21, 2011
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #10826: Prevent sporadic failure in test_subprocess on Solaris due
to open door files.
parent
5ed8b2c7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
19 deletions
+15
-19
Lib/test/subprocessdata/fd_status.py
Lib/test/subprocessdata/fd_status.py
+12
-12
Lib/test/test_subprocess.py
Lib/test/test_subprocess.py
+0
-7
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/subprocessdata/fd_status.py
View file @
ce58dc7b
...
...
@@ -3,22 +3,22 @@ file descriptors on stdout."""
import
errno
import
os
import
fcntl
try
:
_MAXFD
=
os
.
sysconf
(
"SC_OPEN_MAX"
)
except
:
_MAXFD
=
256
def
isopen
(
fd
):
"""Return True if the fd is open, and False otherwise"""
try
:
fcntl
.
fcntl
(
fd
,
fcntl
.
F_GETFD
,
0
)
except
IOError
as
e
:
if
e
.
errno
==
errno
.
EBADF
:
return
False
raise
return
True
if
__name__
==
"__main__"
:
print
(
','
.
join
(
str
(
fd
)
for
fd
in
range
(
0
,
_MAXFD
)
if
isopen
(
fd
)))
fds
=
[]
for
fd
in
range
(
0
,
_MAXFD
):
try
:
st
=
os
.
fstat
(
fd
)
except
OSError
as
e
:
if
e
.
errno
==
errno
.
EBADF
:
continue
raise
# Ignore Solaris door files
if
st
.
st_mode
&
0xF000
!=
0xd000
:
fds
.
append
(
fd
)
print
(
','
.
join
(
map
(
str
,
fds
)))
Lib/test/test_subprocess.py
View file @
ce58dc7b
...
...
@@ -1156,9 +1156,6 @@ class POSIXProcessTestCase(BaseTestCase):
open_fds
=
set
()
if
support
.
verbose
:
print
(
" -- maxfd ="
,
subprocess
.
MAXFD
)
for
x
in
range
(
5
):
fds
=
os
.
pipe
()
self
.
addCleanup
(
os
.
close
,
fds
[
0
])
...
...
@@ -1173,10 +1170,6 @@ class POSIXProcessTestCase(BaseTestCase):
remaining_fds
=
set
(
map
(
int
,
output
.
split
(
b','
)))
to_be_closed
=
open_fds
-
{
fd
}
# Temporary debug output for intermittent failures
if
support
.
verbose
:
print
(
" -- fds that should have been closed:"
,
to_be_closed
)
print
(
" -- fds that remained open:"
,
remaining_fds
)
self
.
assertIn
(
fd
,
remaining_fds
,
"fd to be passed not passed"
)
self
.
assertFalse
(
remaining_fds
&
to_be_closed
,
...
...
Misc/NEWS
View file @
ce58dc7b
...
...
@@ -45,6 +45,9 @@ Build
Tests
-----
- Issue #10826: Prevent sporadic failure in test_subprocess on Solaris due
to open door files.
- Issue #10990: Prevent tests from clobbering a set trace function.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment