• File: windows_utils.cpython-37.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/proc/self/root/opt/alt/python37/lib64/python3.7/asyncio/__pycache__/windows_utils.cpython-37.pyc
  • Date Modified: 10/26/2026 8:08 PM
  • File size: 4.29 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

Lj@sdZddlZejdkredddlZddlZddlZddlZddlZddl	Z	ddl
Z
dZdZej
Z
ejZeZdded	d
dZGdd
d
ZGdddejZdS)z)Various Windows specific bits and pieces.NZwin32z
win32 only)pipePopenPIPE
PipeHandlei F)TT)duplex
overlappedbufsizec
Cs"tjdtttd}|r>tj}tj	tj
B}||}}ntj}tj
}d|}}|tjO}|drp|tj
O}|drtj
}nd}d}	}
yZt||tjd||tjtj}	t||dtjtj|tj}
tj|	dd}|d|	|
fS|	dk	rt|	|
dk	rt|
YnXdS)zELike os.pipe() but with overlapped support and using handles not fds.z\\.\pipe\python-pipe-{:d}-{:d}-)prefixrNT)r)tempfileZmktempformatosgetpidnext
_mmap_counter_winapiZPIPE_ACCESS_DUPLEXZGENERIC_READZ
GENERIC_WRITEZPIPE_ACCESS_INBOUNDZFILE_FLAG_FIRST_PIPE_INSTANCEZFILE_FLAG_OVERLAPPEDZCreateNamedPipeZ	PIPE_WAITZNMPWAIT_WAIT_FOREVERZNULLZ
CreateFileZ
OPEN_EXISTINGZConnectNamedPipeZGetOverlappedResultCloseHandle)rrrZaddressZopenmodeaccessZobsizeZibsizeZflags_and_attribsZh1Zh2Zovr:/opt/alt/python37/lib64/python3.7/asyncio/windows_utils.pyr sB








rc@s\eZdZdZddZddZeddZdd	Ze	j
d
ddZd
dZddZ
ddZdS)rzWrapper for an overlapped pipe handle which is vaguely file-object like.

    The IOCP event loop can use these instead of socket objects.
    cCs
||_dS)N)_handle)selfhandlerrr__init__VszPipeHandle.__init__cCs2|jdk	rd|j}nd}d|jjd|dS)Nzhandle=closed< >)r	__class____name__)rrrrr__repr__Ys
zPipeHandle.__repr__cCs|jS)N)r)rrrrr`szPipeHandle.handlecCs|jdkrtd|jS)NzI/O operation on closed pipe)r
ValueError)rrrrfilenods
zPipeHandle.fileno)rcCs|jdk	r||jd|_dS)N)r)rrrrrcloseis

zPipeHandle.closecCs,|jdk	r(tjd|t|d|dS)Nz	unclosed )source)rwarningswarnResourceWarningr#)rrrr__del__ns
zPipeHandle.__del__cCs|S)Nr)rrrr	__enter__tszPipeHandle.__enter__cCs|dS)N)r#)rtvtbrrr__exit__wszPipeHandle.__exit__N)r
__module____qualname____doc__rr propertyrr"rrr#r(r)r-rrrrrQsrcs"eZdZdZdfdd	ZZS)rzReplacement for subprocess.Popen using overlapped pipe handles.

    The stdin, stdout, stderr are None or instances of PipeHandle.
    Nc	s|drt|dddks"td}}}d}	}
}|tkrbtddd\}}	t|tj}n|}|tkrtdd\}
}
t|
d}n|}|tkrtdd\}}t|d}n|tkr|}n|}zy t	j
|f|||d	|Wn4x$|	|
|fD]}|dk	rt|qWYn>X|	dk	r0t
|	|_|
dk	rDt
|
|_|dk	rXt
||_Wd|tkrpt||tkrt||tkrt|XdS)
NZuniversal_newlinesrr)FTT)rr)TF)r)stdinstdoutstderr)getAssertionErrorrrmsvcrtZopen_osfhandler
O_RDONLYSTDOUTsuperrrrrr2r3r4r#)rargsr2r3r4kwdsZ	stdin_rfdZ
stdout_wfdZ
stderr_wfdZstdin_whZ	stdout_rhZ	stderr_rhZstdin_rhZ	stdout_whZ	stderr_whh)rrrrsL









zPopen.__init__)NNN)rr.r/r0r
__classcell__rr)rrr~sr)r0sysplatformImportErrorr	itertoolsr7r

subprocessrr%__all__ZBUFSIZErr9countrrrrrrrr<module>s$
1-