[Python-Dev] [Python-checkins] r88484 - in python/branches/py3k: Lib/test/subprocessdata/fd_status.py Lib/test/test_subprocess.py Misc/NEWS

Victor Stinner victor.stinner at haypocalc.com
Tue Feb 22 01:02:58 CET 2011


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


More information about the Python-Dev mailing list