Le 21/02/2011 22:55, antoine.pitrou a écrit :
Author: antoine.pitrou
Date: Mon Feb 21 22:55:48 2011
New Revision: 88484

Log:
Issue #10826: Prevent sporadic failure in test_subprocess on Solaris due
to open door files.
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)

Are 0xF000 and 0xD000 constants specific to Solaris? If yes, you may only skip these files on Solaris, not on other OSes.

Victor
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to