+
     Bi]                        . R=Ot ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^RI
Ht ^RI
HtHt ^RIHt ]P                   t ^ RIt^ RIt^ RIHtHtHtHt R>tRt]P8                  ! 4       tR	tR	.t] ! ]R
4      '       d   R
t]R
.,          t]P2                  R8X  d   Rt]R.,          t]3R lt!R t"R t#R t$R t% ! R R4      t&]'       d    ! R R]&4      t' ! R R]&4      t( ! R R])4      t*R?R lt+]P2                  R8w  d   R@R lt,MR@R lt, ! R R])4      t-R t.]P2                  R8X  d    ! R R])4      t/R  t0^(t1R!t2R"t3R#t4]5! 0 RAm4      t6]7! R$ ]6 4       4      t8^t9^t:]9]:3t;R% t<R& t=R' t>RBR( R) llt?R* R+ lt@ ! R, R-])4      tAR. tBR/ tC ! R0 R1]*4      tDR2 tE]P2                  R8X  d"   R3 tF]P                  ]P                  0tIRCR4 ltJM1^ RIKtK] ! ]KR54      '       d   ]KP                  tMM]KP                  tMRCR6 ltJ]P2                  R8X  d5   R7 tOR8 tP]P                  ! ](]O4       R9 tRR: tS]P                  ! ]']R4       R# R; tOR< tP]P                  ! ](]O4       R#   ] d    ]P2                  R8X  d   h Rt EL%i ; i)DClientListenerN)util)AuthenticationErrorBufferTooShort)	reduction)WAIT_OBJECT_0WAIT_ABANDONED_0WAIT_TIMEOUTINFINITEwin32g      4@AF_INETAF_UNIXAF_PIPEc                 :    \         P                  ! 4       V ,           # Ntime	monotonic)timeouts   &1/usr/lib/python3.14/multiprocessing/connection.py_init_timeoutr   >   s    >>g%%    c                 2    \         P                  ! 4       V 8  # r   r   )ts   &r   _check_timeoutr   A   s    >>ar   c                   V R8X  d   R	# V R8X  d,   \         P                  ! R\        P                  ! 4       R7      # V R8X  dB   \         P                  ! R\        P
                  ! 4       \        \        4      3,          RR7      # \        R4      h)
z7
Return an arbitrary free address for the given family
r   r   zsock-)prefixdirr   z\\.\pipe\pyc-%d-%d- zunrecognized family)	localhost    )	tempfilemktempr   get_temp_dirosgetpidnext_mmap_counter
ValueErrorfamilys   &r   arbitrary_addressr,   H   s|     	9	g43D3D3FGG	9	&< "		T--@A'BGIK 	K .//r   c                    \         P                  R8w  d   V R8X  d   \        RV ,          4      h\         P                  R8X  d4   V R8X  d+   \        \        V 4      '       g   \        RV ,          4      hR# R# R# )z<
Checks if the family is valid for the current environment.
r   r   zFamily %s is not recognized.r   N)sysplatformr)   hasattrsocketr*   s   &r   _validate_familyr2   V   sf     ||w6Y#67&@AA
||w6Y#6vv&&;fDEE ' $7r   c                   \        V 4      \        8X  d   R# \        V 4      \        J d   V P                  R4      '       d   R# \        V 4      \        J g   \        P
                  ! V 4      '       d   R# \        RV ,          4      h)zQ
Return the types of the address

This can be 'AF_INET', 'AF_UNIX', or 'AF_PIPE'
r   z\\r   r   zaddress type of %r unrecognized)typetuplestr
startswithr   is_abstract_socket_namespacer)   )addresss   &r   address_typer:   b   sb     G}	g#	'"4"4V"<"<	g#	!B!B7!K!K:WDEEr   c                      a  ] tR t^ut o RtRR ltR tR tR tR t	R t
]R 4       t]R	 4       t]R
 4       tR tR tR tRR ltR tRR ltRR ltR tRR ltR tR tRtV tR# )_ConnectionBaseNc                    VP                  4       pV^ 8  d   \        R4      hV'       g   V'       g   \        R4      hWn        W n        W0n        R# )r!   zinvalid handlez6at least one of `readable` and `writable` must be TrueN)	__index__r)   _handle	_readable	_writable)selfhandlereadablewritables   &&&&r   __init___ConnectionBase.__init__x   sI    !!#A:-..HJ J!!r   c                F    V P                   e   V P                  4        R # R # r   r?   _closerB   s   &r   __del___ConnectionBase.__del__   s    <<#KKM $r   c                8    V P                   f   \        R4      hR # )Nhandle is closed)r?   OSErrorrK   s   &r   _check_closed_ConnectionBase._check_closed   s    <<,--  r   c                @    V P                   '       g   \        R 4      hR# )zconnection is write-onlyN)r@   rP   rK   s   &r   _check_readable_ConnectionBase._check_readable   s    ~~~455 r   c                @    V P                   '       g   \        R 4      hR# )zconnection is read-onlyN)rA   rP   rK   s   &r   _check_writable_ConnectionBase._check_writable   s    ~~~344 r   c                l    V P                   '       d	   R V n        MV P                  4        \        R4      h)Fzbad message length)rA   r@   closerP   rK   s   &r   _bad_message_length#_ConnectionBase._bad_message_length   s'    >>>"DNJJL*++r   c                    V P                   RJ # )z True if the connection is closedNr?   rK   s   &r   closed_ConnectionBase.closed   s     ||t##r   c                    V P                   # )z"True if the connection is readable)r@   rK   s   &r   rD   _ConnectionBase.readable        ~~r   c                    V P                   # )z"True if the connection is writable)rA   rK   s   &r   rE   _ConnectionBase.writable   rc   r   c                :    V P                  4        V P                  # )z+File descriptor or handle of the connection)rQ   r?   rK   s   &r   fileno_ConnectionBase.fileno   s    ||r   c                n    V P                   e    V P                  4        RV n         R# R#   RT n         i ; i)zClose the connectionNrI   rK   s   &r   rZ   _ConnectionBase.close   s1    <<#$#	 $  $s   + 	4c                    RV n         R# )z7Stop managing the underlying file descriptor or handle.Nr^   rK   s   &r   _detach_ConnectionBase._detach   s	    r   c                   V P                  4        V P                  4        \        V4      pVP                  ^8  d   VP	                  R4      pVP
                  pV^ 8  d   \        R4      hWR8  d   \        R4      hVf
   WR,
          pM*V^ 8  d   \        R4      hW#,           V8  d   \        R4      hV P                  WBW#,            4       R# )z,Send the bytes data from a bytes-like objectBzoffset is negativezbuffer length < offsetNzsize is negativezbuffer length < offset + size)rQ   rW   
memoryviewitemsizecastnbytesr)   _send_bytes)rB   bufoffsetsizemns   &&&&  r   
send_bytes_ConnectionBase.send_bytes   s    sO::>sAHHA:122:566<:DAX/00]Q<==&-01r   c                    V P                  4        V P                  4        V P                  \        P	                  V4      4       R# )zSend a (picklable) objectN)rQ   rW   rt   _ForkingPicklerdumpsrB   objs   &&r   send_ConnectionBase.send   s3    ..s34r   c                    V P                  4        V P                  4        Ve   V^ 8  d   \        R4      hV P                  V4      pVf   V P	                  4        VP                  4       # )z'
Receive bytes data as a bytes object.
znegative maxlength)rQ   rT   r)   _recv_bytesr[   getvalue)rB   	maxlengthru   s   && r   
recv_bytes_ConnectionBase.recv_bytes   sa     	 Y]122y);$$&||~r   c                (   V P                  4        V P                  4        \        V4      ;_uu_ 4       pVP                  pV\	        V4      ,          pV^ 8  d   \        R4      hW%8  d   \        R4      hV P                  4       pVP                  4       pWRV,           8  d   \        VP                  4       4      hVP                  ^ 4       VP                  W2V,          W',           V,           4       VuuRRR4       #   + '       g   i     R# ; i)zY
Receive bytes data into a writeable bytes-like object.
Return the number of bytes read.
znegative offsetzoffset too largeN)rQ   rT   rp   rq   lenr)   r   tellr   r   seekreadinto)rB   ru   rv   rx   rq   bytesizeresultrw   s   &&&     r   recv_bytes_into_ConnectionBase.recv_bytes_into   s    
 	__zzH#a&(Hz !233" !344%%'F;;=D4-'$V__%677KKNOOA0%}9; <! ___s   CD  D	c                    V P                  4        V P                  4        V P                  4       p\        P	                  VP                  4       4      # )zReceive a (picklable) object)rQ   rT   r   r}   loads	getbuffer)rB   ru   s   & r   recv_ConnectionBase.recv   s?     $$S]]_55r   c                d    V P                  4        V P                  4        V P                  V4      # )z/Whether there is any input available to be read)rQ   rT   _pollrB   r   s   &&r   poll_ConnectionBase.poll  s)    zz'""r   c                    V # r    rK   s   &r   	__enter___ConnectionBase.__enter__	      r   c                &    V P                  4        R # r   rZ   rB   exc_type	exc_valueexc_tbs   &&&&r   __exit___ConnectionBase.__exit__      

r   )r?   r@   rA   )TTr!   Nr   r!   )g        )__name__
__module____qualname____firstlineno__r?   rF   rL   rQ   rT   rW   r[   propertyr_   rD   rE   rg   rZ   rl   rz   r   r   r   r   r   r   r   __static_attributes____classdictcell____classdict__s   @r   r<   r<   u   s     G	".65, $ $    
$2(526# r   r<   c                   h   a  ] tR tRt o RtRtRt]P                  3R lt	R t
RR ltR tR	 tR
tV tR# )PipeConnectioni  z
Connection class based on a Windows named pipe.
Overlapped I/O is used, so the handles must have been created
with FILE_FLAG_OVERLAPPED.
FNc                j    V P                   pVe   VP                  4        V! V P                  4       R # r   )_send_ovcancelr?   )rB   _CloseHandleovs   && r   rJ   PipeConnection._close  s%    B~		&r   c                T   V P                   e   \        R4      h\        P                  ! V P                  VRR7      w  r#W n          V\        P
                  8X  d5   \        P                  ! VP                  .R\        4      pV\        8X  g   Q hR T n         TP                  R4      w  rST\        P                  8X  d   \        \        P                  R4      hT^ 8X  g   Q hT\!        T4      8X  g   Q hR #    TP                  4        h ; i  R T n         TP                  R4      w  rSi ; i)Nz/concurrent send_bytes() calls are not supportedT
overlappedFrO   )r   r)   _winapi	WriteFiler?   ERROR_IO_PENDINGWaitForMultipleObjectseventr   r   r   GetOverlappedResultERROR_OPERATION_ABORTEDrP   errnoEPIPEr   )rB   ru   r   errwaitresnwrittens   &&    r   rt   PipeConnection._send_bytes"  s   }}(  "5 6 6''cdKGBM
='222%<<
E85G"m333
 !% " 6 6t <g555 ekk+=>>!8O8s3x'''		 $ " 6 6t <#s   A	C5 5DD D'c                B   V P                   '       d   R V n         \        P                  ! 4       # Vf   ^M\        V^4      p \        P
                  ! V P                  VRR7      w  r4\        4       pTp  V\        P                  8X  d5   \        P                  ! VP                  .R \        4      pV\        8X  g   Q hTP                  R4      w  rT^ 8X  d8   \        P                  ! 4       p	T	P                  TP!                  4       4       T	pM&T\        P"                  8X  d   T P%                  Y14      pYeJd   T#  \/        R4      h   TP                  4        h ; i  TP                  R4      w  rT^ 8X  d8   \        P                  ! 4       p	T	P                  TP!                  4       4       T	pi T\        P"                  8X  d   T P%                  Y14      pi i ; i   YeJ d   h  L; i  \&         d,   p
T
P(                  \        P*                  8X  d   \,        hh Rp
?
ii ; i)FNTr   z.shouldn't get here; expected KeyboardInterrupt)_got_empty_messageioBytesIOminr   ReadFiler?   objectr   r   r   r   r   r   r   writer   ERROR_MORE_DATA_get_more_datarP   winerrorERROR_BROKEN_PIPEEOFErrorRuntimeError)rB   maxsizebsizer   r   sentinelreturn_valuer   nreadfes   &&         r   r   PipeConnection._recv_bytes<  s   &&&*/'zz|#&C4E!%..t||U;?AGB  &xH#+L"P"g&>&>>*1*H*H%'XXJx+A'.-'? ?'?
 *,)?)?)EJE"ax$&JJL ! 7/0!$(?(?!?/3/B/B2/O
 $3++ 4 OPP-"IIK!)+)?)?)EJE"ax$&JJL ! 7/0!$(?(?!?/3/B/B2/O "@"'3! 4
  zzW%>%>>&	s]   1G( 5A	E >AG G( &G 5G( EE A:GG G%#G( (H3&HHc                    V P                   '       g-   \        P                  ! V P                  4      ^ ,          ^ 8w  d   R# \	        \        V .V4      4      # )r!   T)r   r   PeekNamedPiper?   boolwaitr   s   &&r   r   PipeConnection._pollf  sA    '''--dll;A>!CdVW-..r   c                   VP                  4       p\        P                  ! 4       pVP                  V4       \        P
                  ! V P                  4      ^,          pV^ 8  g   Q hVe(   \        V4      V,           V8  d   V P                  4        \        P                  ! V P                  VRR7      w  rVP                  R4      w  rvV^ 8X  g   Q hWu8X  g   Q hVP                  VP                  4       4       V# )   Tr   )r   r   r   r   r   r   r?   r   r[   r   r   )rB   r   r   ru   r   leftr   rbytess   &&&     r   r   PipeConnection._get_more_datal  s    ,,.C

AGGCL((6q9D!8O8"s3x$'@((*&&t||TdKGB006KF!8O8>!>GGBLLN#Hr   )r   r   r   )r   r   r   r   __doc__r   r   r   CloseHandlerJ   rt   r   r   r   r   r   r   s   @r   r   r     s@     	
 #&-&9&9 	'	(4(	QT	/	 	r   r   c                     a  ] tR tRt o Rt]'       d*   ]P                  3R lt]P                  t
]P                  tM(]P                  3R lt]P                  t
]P                   t]
3R lt]3R ltR tRR	 ltR
 tRtV tR# )
Connectioni|  zc
Connection class based on an arbitrary file descriptor (Unix only), or
a socket handle (Windows).
c                *    V! V P                   4       R # r   r^   rB   rJ   s   &&r   rJ   Connection._close      4<< r   c                *    V! V P                   4       R # r   r^   r   s   &&r   rJ   r     r   r   c                n    \        V4      p V! V P                  V4      pW4,          pV^ 8X  d   R# WR pK+  )TN)r   r?   )rB   ru   r   	remainingry   s   &&&  r   _sendConnection._send  s8    H	dllC(ANIA~b'Cr   c                   \         P                  ! 4       pV P                  pTpV^ 8  d]   \        \        V4      pV! WF4      p\        V4      pV^ 8X  d   WQ8X  d   \        h\        R4      hVP                  V4       WX,          pKc  V# )r!   zgot end of file during message)	r   r   r?   r   BUFSIZEr   r   rP   r   )	rB   rw   readru   rC   r   to_readchunkry   s	   &&&      r   _recvConnection._recv  sw    jjl	!m'9-G)EE
AAv$"N!"BCCIIeNI
r   c                   \        V4      pVR 8  dd   \        P                  ! RR4      p\        P                  ! RV4      pV P                  V4       V P                  V4       V P                  V4       R# \        P                  ! RV4      pVR8  d%   V P                  V4       V P                  V4       R# V P                  WA,           4       R# )i!i!Qi @  N)r   structpackr   )rB   ru   ry   
pre_headerheaders   &&   r   rt   Connection._send_bytes  s    Hz>T2.J[[q)FJJz"JJvJJsO [[q)F5y 

6"

3 

6<(r   Nc                *   V P                  ^4      p\        P                  ! RVP                  4       4      w  pVR8X  d9   V P                  ^4      p\        P                  ! RVP                  4       4      w  pVe	   W18  d   R# V P                  V4      # )   r  r  Nr  )r   r  unpackr   )rB   r   ru   rw   s   &&  r   r   Connection._recv_bytes  so    jjmdCLLN32:**Q-CMM$7ED4>zz$r   c                2    \        V .V4      p\        V4      # r   )r   r   )rB   r   rs   && r   r   Connection._poll  s    $!Awr   r   r   )r   r   r   r   r   r   _multiprocessingclosesocketrJ   r   _writer   _readr%   rZ   r   r   r   r   rt   r   r   r   r   r   s   @r   r   r   |  sw     
  0 < < 	!!&& %% " 	!%   % ").  r   r   c                   f   a  ] tR tRt o RtRR ltR tR t]R 4       t	]R 4       t
R	 tR
 tRtV tR# )r   i  z
Returns a listener object.

This is a wrapper for a bound socket which is 'listening' for
connections, or for a Windows named pipe.
Nc                H   T;'       g$    T;'       d    \        V4      ;'       g    \        pT;'       g    \        V4      p\        V4       VR 8X  d   \	        W4      V n        M\        WV4      V n        Ve"   \        V\        4      '       g   \        R4      hW@n
        R# )r   Nauthkey should be a byte string)r:   default_familyr,   r2   PipeListener	_listenerSocketListener
isinstancebytes	TypeError_authkey)rB   r9   r+   backlogauthkeys   &&&&&r   rF   Listener.__init__  s     # #G==W(= # #" 	66.v6 Y)';DN+GWEDNz'5'A'A=>>r   c                    V P                   f   \        R4      hV P                   P                  4       pV P                  e+   \	        WP                  4       \        WP                  4       V# )zb
Accept a connection on the bound socket or named pipe of `self`.

Returns a `Connection` object.
zlistener is closed)r  rP   acceptr  deliver_challengeanswer_challenge)rB   cs   & r   r$  Listener.accept  sS     >>!.//NN!!#==$a/Q.r   c                X    V P                   pVe   RV n         VP                  4        R# R# )z1
Close the bound socket or named pipe of `self`.
N)r  rZ   )rB   listeners   & r   rZ   Listener.close  s)     >>!DNNN  r   c                .    V P                   P                  # r   )r  _addressrK   s   &r   r9   Listener.address   s    ~~&&&r   c                .    V P                   P                  # r   )r  _last_acceptedrK   s   &r   last_acceptedListener.last_accepted  s    ~~,,,r   c                    V # r   r   rK   s   &r   r   Listener.__enter__  r   r   c                &    V P                  4        R # r   r   r   s   &&&&r   r   Listener.__exit__  r   r   )r  r  )NNr   N)r   r   r   r   r   rF   r$  rZ   r   r9   r1  r   r   r   r   r   s   @r   r   r     sP        ' ' - - r   c                    T;'       g    \        V 4      p\        V4       VR8X  d   \        V 4      pM\        V 4      pVe"   \	        V\
        4      '       g   \        R4      hVe   \        W24       \        W24       V# )z5
Returns a connection to the address of a `Listener`
r   r  )	r:   r2   
PipeClientSocketClientr  r  r  r&  r%  )r9   r+   r!  r'  s   &&& r   r   r     ss     ,,|G,FVw!:gu#=#=9::$!%Hr   c                V   V '       do   \         P                  ! 4       w  rVP                  R4       VP                  R4       \        VP	                  4       4      p\        VP	                  4       4      pW43# \
        P                  ! 4       w  rV\        VRR7      p\        VRR7      pW43# )<
Returns pair of connection objects at either end of a pipe
TFrE   rD   )r1   
socketpairsetblockingr   detachr%   pipe)duplexs1s2c1c2fd1fd2s   &      r   PiperI  &  s     &&(FBNN4 NN4 BIIK(BBIIK(B v	 wwyHCC%0BC%0Bvr   c           
        \        R4      pV '       dB   \        P                  p\        P                  \        P                  ,          p\
        \
        rTM'\        P                  p\        P                  p^ \
        rT\        P                  ! W\        P                  ,          \        P                  ,          \        P                  \        P                  ,          \        P                  ,          ^WE\        P                  \        P                  4      p\        P                  ! W^ \        P                  \        P                   \        P                  \        P                  4      p\        P"                  ! V\        P                  RR4       \        P$                  ! VRR7      pVP'                  R4      w  rV
^ 8X  g   Q h\)        W`R7      p\)        WpR7      pW3# )r;  r   NTr   r<  r=  )r,   r   PIPE_ACCESS_DUPLEXGENERIC_READGENERIC_WRITEr   PIPE_ACCESS_INBOUNDCreateNamedPipeFILE_FLAG_OVERLAPPEDFILE_FLAG_FIRST_PIPE_INSTANCEPIPE_TYPE_MESSAGEPIPE_READMODE_MESSAGE	PIPE_WAITNMPWAIT_WAIT_FOREVERNULL
CreateFileOPEN_EXISTINGSetNamedPipeHandleStateConnectNamedPiper   r   )rB  r9   openmodeaccessobsizeibsizeh1h2r   _r   rE  rF  s   &            r   rI  rI  9  sW    $I.11H))G,A,AAF$gF22H**FF$$ < <<112%%(E(EEvw;;LL Qg.C.C((',, 	''--tT	 --bTB
//5axxB0B0vr   c                   :   a  ] tR tRt o RtRR ltR tR tRtV t	R# )	r  ie  zG
Representation of a socket which is bound to an address and listening
c                   \         P                   ! \        \         V4      4      V n         \        P                  R 8X  d:   V P                  P                  \         P                  \         P                  ^4       V P                  P                  R4       V P                  P                  V4       V P                  P                  V4       V P                  P                  4       V n        Y n        RT n        TR8X  dM   \"        P$                  ! T4      '       g1   \"        P&                  ! T \        P(                  T3^ R7      T n        R# RT n        R#   \         d    T P                  P                  4        h i ; i)posixTNr   argsexitpriority)r1   getattr_socketr%   name
setsockopt
SOL_SOCKETSO_REUSEADDRr?  bindlistengetsocknamer-  rP   rZ   _familyr0  r   r8   Finalizeunlink_unlink)rB   r9   r+   r   s   &&&&r   rF   SocketListener.__init__i  s   }}WVV%<=	ww'!''(9(9(.(;(;Q@LL$$T*LLg&LL( LL446DM "Yt'H'H'Q'Q==biiwjqDL  DL  	LL 	s   B>E 'E9c                    V P                   P                  4       w  qn        VP                  R 4       \	        VP                  4       4      # T)ri  r$  r0  r?  r   r@  rB   ss   & r   r$  SocketListener.accept  s7    !%!4!4!6	d!((*%%r   c                     V P                   P                  4        V P                  pVe   R V n        V! 4        R # R #   T P                  pTe   R T n        T! 4        i i ; ir   )ri  rZ   rt  )rB   rs  s   & r   rZ   SocketListener.close  s[    	LL \\F!# " \\F!# "s	   > !A)r-  rq  r0  ri  rt  N)r   )
r   r   r   r   r   rF   r$  rZ   r   r   r   s   @r   r  r  e  s      2&
 r   r  c                $   \        V 4      p\        P                  ! \        \        V4      4      ;_uu_ 4       pVP                  R4       VP	                  V 4       \        VP                  4       4      uuRRR4       #   + '       g   i     R# ; i)zG
Return a connection object connected to the socket given by `address`
TN)r:   r1   rh  r?  connectr   r@  )r9   r+   ry  s   &  r   r9  r9    s[     '"F	/	1	1Q	d			'!((*% 
2	1	1	1s   ;A>>B	c                   N   a  ] tR tRt o RtR	R ltR
R ltR t]R 4       t	Rt
V tR# )r  i  z 
Representation of a named pipe
Nc                   Wn         V P                  R R7      .V n        RV n        \        P
                  ! RV P                   4       \        P                  ! V \        P                  V P                  V P                   3^ R7      V n	        R# )T)firstNz listener created with address=%rre  )
r-  _new_handle_handle_queuer0  r   	sub_debugrr  r  _finalize_pipe_listenerrZ   )rB   r9   r   s   &&&r   rF   PipeListener.__init__  sj    #M"&"2"2"2">!?D"&DNN=t}}Ml::(($--8qDJr   c           
        \         P                  \         P                  ,          pV'       d   V\         P                  ,          p\         P                  ! V P
                  V\         P                  \         P                  ,          \         P                  ,          \         P                  \        \        \         P                  \         P                  4      # r   )r   rK  rP  rQ  rO  r-  rR  rS  rT  PIPE_UNLIMITED_INSTANCESr   rU  rV  )rB   r  flagss   && r   r  PipeListener._new_handle  s    ..1M1MME>>>**u))G,I,II!!"00'7,,gll r   c                h   V P                   P                  V P                  4       4       V P                   P                  ^ 4      p \        P
                  ! VRR7      p \        P                  ! VP                  .R\        4      p TP                  R4      w  rET^ 8X  g   Q h \        T4      #    TP                  4        \        P                  ! T4       h ; i  TP                  R4      w  rET^ 8X  g   Q hi ; i  \         d+   pTP                  \        P                  8w  d   h  Rp?LRp?ii ; i)r!   Tr   FN)r  appendr  popr   rZ  r   r   r   r   r   r   rP   r   ERROR_NO_DATAr   )rB   rC   r   resra  r   r   s   &      r   r$  PipeListener.accept  s   %%d&6&6&89''++A.F$--fF	$!88
E85C  33D9FA!8O8!&))IIK''/33D9FA!8O8  ::!6!66 7s0   C< 'B/ /)CC C9<D1 D,,D1c                r    \         P                  ! R V4       V  F  p\        P                  ! V4       K  	  R# )z closing listener with address=%rN)r   r  r   r   )queuer9   rC   s   && r   r  $PipeListener._finalize_pipe_listener  s)    NN=wG##F+  r   )r-  r  r0  rZ   r   )F)r   r   r   r   r   rF   r  r$  staticmethodr  r   r   r   s   @r   r  r    s-     			
		*. 
	, 
	,r   r  c           	     R   \        4       p  \        P                  ! V R4       \        P                  ! V \        P                  \        P
                  ,          ^ \        P                  \        P                  \        P                  \        P                  4      p \        P                  ! T\        P                  RR4       \!        T4      #   \         dN   pTP                  \        P                  \        P                  39  g   \        T4      '       d   h  Rp?EK  Rp?ii ; i)zE
Return a connection object connected to the pipe given by `address`
  N)r   r   WaitNamedPiperW  rL  rM  rV  rX  rP  rP   r   ERROR_SEM_TIMEOUTERROR_PIPE_BUSYr   rY  rS  r   )r9   r   hr   s   &   r   r8  r8    s     O%%gt4&&W11G4I4IIw||W%:%:00',,  	''w,,dD	 a    ::g&?&?&-&=&=&? ?BPQRBSBS CTs   BC D&AD!!D&s   #CHALLENGE#s	   #WELCOME#s	   #FAILURE#c              #   8   "   T F  p\        V4      x  K  	  R # 5ir   )r   ).0ra  s   & r   	<genexpr>r  W  s     7&6c!ff&6s   c                $   \        V 4      \        9   d   RV 3# V P                  R4      '       dT   V P                  R^\        ^,           4      ;p^ 8  d/   V ^V pV\
        9   d   W^,           R pVP                  R4      V3# \        RV : 24      h)zReturns a digest name and the payload for a response hash.

If a legacy protocol is detected based on the message length
or contents the digest name returned will be empty to indicate
legacy mode where MD5 and no digest prefix should be sent.
r      {   }NasciizRunsupported message length, missing digest prefix, or unsupported digest: message=)r   _LEGACY_LENGTHSr7   find_MAX_DIGEST_LEN_ALLOWED_DIGESTSdecoder   )messagecurlydigestpayloads   &   r   _get_digest_name_and_payloadr  b  s     7|&
 7{4  ,,tQ(9:	:a?5!%%Agh'G==)722
/&-Z12 2r   c                   ^ RI p\        V4      ^ ,          pV'       g"    VP                  WR4      P                  4       # VP                  WV4      P                  4       pRVP                  R4      V3,          #   \         d    Rp LIi ; i)ao  Create a MAC based on authkey and message

The MAC algorithm defaults to HMAC-MD5, unless MD5 is not available or
the message has a '{digest_name}' prefix. For legacy HMAC-MD5, the response
is the raw MAC, otherwise the response is prefixed with '{digest_name}',
e.g. b'{sha256}abcdefg...'

Note: The MAC protects the entire message including the digest_name prefix.
Nmd5sha256   {%s}%sr  )hmacr  newr  r)   encode)r!  r  r  digest_nameresponses   &&   r   _create_responser  |  s     .w7:K	#88Ge4;;== xx+6==?H**73X>>>  	# #K		#s   A: :B
	B
c           
        ^ RI p\        V4      w  rET;'       g    Rp VP                  WV4      P                  4       p\        T4      \        T4      8w  d(   \        RT: R\        T4       R\        T4       24      hTP                  Ye4      '       g   \        R4      hR#   \         d    \        RT: R24      hi ; i)	aH  Verify MAC challenge

If our message did not include a digest_name prefix, the client is allowed
to select a stronger digest_name from _ALLOWED_DIGESTS.

In case our message is prefixed, a client cannot downgrade to a weaker
algorithm, because the MAC is calculated over the entire message
including the '{digest_name}' prefix.
Nr  zresponse_digest=z unsupportedz	expected z of length z got zdigest received was wrong)r  r  r  r  r)   r   r   compare_digest)r!  r  r  r  response_digestresponse_macexpecteds   &&&    r   _verify_challenger    s     $@$J!O%..OE88Go>EEG 8}L))!O.k#h- I<()+, 	, x66!"=>> 7  E!%5_$6l"CDDEs    B# #B?c                $    V ^8  d   QhR\         /#    r!  r  )formats   "r   __annotate__r    s     ( (5 (r   c                    \        V\        4      '       g$   \        R P                  \	        V4      4      4      h\
        \        8  g   Q R4       h\        P                  ! \
        4      pRVP                  R4      V3,          pV P                  \        V,           4       V P                  R4      p \        WV4       V P                  \        4       R#   \         d    T P                  \         4       h i ; i) Authkey must be bytes, not {0!s}zprotocol constraintr  r     N)r  r  r)   r  r4   MESSAGE_LENGTH_MD5ONLY_MESSAGE_LENGTHr%   urandomr  rz   
_CHALLENGEr   r  _WELCOMEr   _FAILURE)
connectionr!  r  r  r  s   &&&  r   r%  r%    s    gu%%.55d7mDF 	F33J5JJ3jj(G;--g6@@G *w./$$S)H('H5
 	h'	  h's   2C "C7c                $    V ^8  d   QhR\         /# r  r  )r  s   "r   r  r    s     > >% >r   c                    \        V\        4      '       g$   \        R P                  \	        V4      4      4      hV P                  R4      pVP                  \        4      '       g   \        RV: 24      hV\        \        4      R p\        V4      \        8  d   \        R\        V4       R24      h\        W4      pV P                  V4       V P                  R4      pV\        8w  d   \        R4      hR# )r  r  z,Protocol error, expected challenge: message=Nzchallenge too short: z byteszdigest sent was rejected)r  r  r)   r  r4   r   r7   r  r   r   r  r  rz   r  )r  r!  r  r  r  s   &&   r   r&  r&    s    gu%%.55d7mDF 	F##C(Gj))!?wjAC 	Cc*o&'G
7|--!$9#g,v"NOOg/F&!$$S)H8!"<== r   c                   2   a  ] tR tRt o R tR tR tRtV tR# )ConnectionWrapperi  c                j    Wn         W n        W0n        R F  p\        W4      p\	        WV4       K  	  R# )rg   N)rg   rZ   r   r   rz   )_conn_dumps_loadsrh  setattr)rB   connr~   r   attrr   s   &&&&  r   rF   ConnectionWrapper.__init__  s0    
KD$%CD$ Lr   c                ^    V P                  V4      pV P                  P                  V4       R # r   )r  r  rz   )rB   r   ry  s   && r   r   ConnectionWrapper.send  s"    KK

a r   c                X    V P                   P                  4       pV P                  V4      # r   )r  r   r  rx  s   & r   r   ConnectionWrapper.recv  s"    JJ!!#{{1~r   )r  r  r  N)	r   r   r   r   rF   r   r   r   r   r   s   @r   r  r    s     %! r   r  c                 T    \         P                  V 3R R R ^4      P                  R4      # )Nutf-8)	xmlrpclibr~   r  )r   s   &r   
_xml_dumpsr    s&    ??C64tQ7>>wGGr   c                 V    \         P                  V P                  R 4      4      w  w  rV# )r  )r  r   r  )ry  r   methods   &  r   
_xml_loadsr    s"    __QXXg%67NFSJr   c                   &   a  ] tR tRt o R tRtV tR# )XmlListeneri  c                b    ^ RI Hs \        P	                  V 4      p\        V\        \        4      # r   )xmlrpc.clientclientr  r   r$  r  r  r  r   s   & r   r$  XmlListener.accept  s"    )ood# j*==r   r   N)r   r   r   r   r$  r   r   r   s   @r   r  r    s     > >r   r  c                  J    ^ RI Hs \        \	        V / VB \
        \        4      # r   )r  r  r  r  r   r  r  )rf  kwdss   *,r   	XmlClientr    s    %VT2T2J
KKr   c                 J  a \        V 4      o. p\        S4      ^<8  d    \        P                  ! SRV4      pTP                  T3R lT 4       4       T'       dB   \        S4       UUu. uF)  w  rEYC^ ,          T,          u;8  d
   T9  g   K#  M K'  TNK+  	  uppo^ pS'       d   \        S4      ^<8  d
   SR,          MSp\        P                  ! VRV4      pV\        8X  d    V# \        Tu;8:  d   \        \        S4      ,           8  d   M MV\        ,          pMC\        Tu;8:  d   \        \        S4      ,           8  d   M MV\        ,          pM\        R4      hVP                  SV,          4       SV^,           R o^ pK  V#   \         d    . u # i ; iu uppi )<   Fc              3   6   <"   T F  pSV,          x  K  	  R # 5ir   r   )r  iLs   & r   r  #_exhaustive_wait.<locals>.<genexpr>  s     +s!1s   :Nr  NzShould not get hereN)listr   r   BatchedWaitForMultipleObjectsTimeoutErrorextend	enumerater   r
   r   r	   r   r  )handlesr   readyr  r  r  short_Lr  s   &&     @r   _exhaustive_waitr    sX    M q6B;;;AugN LL+s++#,Q<M<4111vz3L3LQ3LQ<MG #AafG00%ICl"  #>A(>>}$!SD+;c!f+DD''"#899LL3 #a%&	AG)   	 Ns#   F ) FFFFFc                (  a Vf   \         pM#V^ 8  d   ^ pM\        VR,          R,           4      p\        V 4      p / o. p\        4       p\        4       p V  F  p \	        VR4      p \
        P                  ! V! 4       ^ R4      w  rxV\
        P                  8X  d#   VP                  V4       VSVP                  &   Kg  V'       dW   \        P                  ! 4       R,          R
8  d6    VP                  R4      w  rV'       g   \!        VR4      '       d   RVn        VP%                  V4       ^ pK  	  \+        SP-                  4       V4      pV F  pVP/                  4        K  	  V Fv  p VP                  R4      w  rV\
        P0                  8w  g   K.  SVP                  ,          pVP%                  V4       V^ 8X  g   K[  \!        VR4      '       g   Ko  RVn        Kx  	  TP3                  T3R	 lT 4       4       T  Uu. uF  qUT9   g   K  TNK  	  up#   \         d%   p	RT	P                  rT\        9  d   h  Rp	?	ELRp	?	ii ; i  \         d   p	T	P                  p Rp	?	ELkRp	?	ii ; i  \&         d    TSTP)                  4       &    EK9  i ; i  \         d$   p	T	P                  pT\        9  d   h  Rp	?	EL>Rp	?	ii ; i  T F  pTP/                  4        K  	  T F  p TP                  R4      w  rM0  \         d#   p	T	P                  pT\        9  d   h  Rp	?	MRp	?	ii ; iT\
        P0                  8w  g   K_  STP                  ,          pTP%                  T4       T^ 8X  g   K  \!        TR4      '       g   K  RTn        K  	  i ; iu upi )
Wait till an object in object_list is ready/readable.

Returns list of those objects in object_list which are ready/readable.
Nr  g      ?rg   T:Nr  NFr   c              3   6   <"   T F  pSV,          x  K  	  R # 5ir   r   )r  r  waithandle_to_objs   & r   r  wait.<locals>.<genexpr>p  s     I=a.q11=r  )   r  )r   intr  setrh  r   r   rP   r   _ready_errorsr   r  r   r.   getwindowsversionr   r0   r   addAttributeErrorr>   r  keysr   r   update)object_listr   ov_listready_objectsready_handlesorg   r   r   r   ra  r  s   &&         @r   r   r   %  s,    ?Gq[G'D.3./G;'6	8 $$Q1F
"")"2"268Q"E
 g666r*67)"((3
 #"7"7"9""="G1)+)?)?)F $'716J+K+K7; 4%))!,"#= !@ -->-C-C-EwOM 		  33D9FA
 '999)"((3A!%%a(ax #1&:;;37A0   	I=II&=;a}*<;==_ # ""&

Cm3! 4"  $+ 1&'jj1- & 978%akkm49N  **C-/ 0 		  33D9FAs **C-/ 0 '999)"((3A!%%a(ax #1&:;;37A0 " >s   K I-'H>K !K 'I:K A
K +J NNI!I :K  IK I*I%K %I**K -JK JK KJ<<KN$K87N8L%	L 	N L%	%N?(N,N NPollSelectorc                   \        4       ;_uu_ 4       pV  F#  pVP                  V\        P                  4       K%  	  Ve   \        P
                  ! 4       V,           p VP                  V4      pV'       d+   V UUu. uF  w  rgVP                  NK  	  uppuuRRR4       # Vf   KJ  X\        P
                  ! 4       ,
          pV^ 8  g   Ko  VuuRRR4       # u uppi   + '       g   i     R# ; i)r  N)_WaitSelectorregister	selectors
EVENT_READr   r   selectfileobj)r
  r   selectorr   deadliner  keyeventss   &&      r   r   r     s     __"!!#y';';< # ">>+g5 0=BCUMSCKKUC _ *"*T^^-="="Q;#( _ D __s6   A#C7C<C
C!C' CCCC/	c                 B   V P                  4       p\        P                  ! V\        P                  \        P                  4      ;_uu_ 4       p^RIHp VP                  V4      p\        W@P                  V P                  33uuRRR4       #   + '       g   i     R# ; i)r   )resource_sharerN)rg   r1   fromfdr   SOCK_STREAMr   r  	DupSocketrebuild_connectionrD   rE   )r  rC   ry  r  dss   &    r   reduce_connectionr"    sd    ]]66>>63E3EFF!) **1-B%MM4=='II GFFFs   5BB	c                 V    V P                  4       p\        VP                  4       W4      # r   r@  r   )r!  rD   rE   socks   &&& r   r   r     s     yy{$++-<<r   c                 "   V P                   '       d   \        P                  M^ V P                  '       d   \        P                  M^ ,          p\
        P                  ! V P                  4       V4      p\        W P                   V P                  33# r   )	rD   r   FILE_GENERIC_READrE   FILE_GENERIC_WRITEr   	DupHandlerg   rebuild_pipe_connection)r  r\  dhs   &  r   reduce_pipe_connectionr,    s`    047,,1157--AG  7&]]DMM(JJJr   c                 :    V P                  4       p\        W1V4      # r   )r@  r   )r+  rD   rE   rC   s   &&& r   r*  r*    s    f99r   c                     \         P                  ! V P                  4       4      p\        WP                  V P
                  33# r   )r   DupFdrg   r   rD   rE   )r  dfs   & r   r"  r"    s.    __T[[]+!Bt}}#EEEr   c                 :    V P                  4       p\        W1V4      # r   r$  )r0  rD   rE   fds   &&& r   r   r     s    YY["11r   )r   r   rI  r   i   )NNrw  >      md5   sha256   sha384   sha3_256   sha3_384)r  r   )T__all__r   r   	itertoolsr%   r.   r1   r  r"   r   r   r   r   r   contextr   ForkingPicklerr}   r  r   r   r	   r
   r   ImportErrorr/   r   CONNECTION_TIMEOUTcountr(   r  familiesr0   r   r   r,   r2   r:   r<   r   r   r   r   r   rI  r  r9  r  r8  r  r  r  r  	frozensetr  maxr  r  _MD5_DIGEST_LENr  r  r  r  r%  r&  r  r  r  r  r  r  r   ERROR_NETNAME_DELETEDr  r   r  r  r  SelectSelectorr"  r   r  r,  r*  r   r   r   <module>rE     s   3  	  	 
      1 **OO   !;
69NH<<7NH - & 0
FF&X Xv g gTN Nj;v ;|* <<7&&X)V )X& <<76,v 6,p!> 
r @B 7&677  *O<24?8?2(*>* H>( >L <<7@ ..0M0MNML>` 
 y.))!..!00)6 <<7J= z#45K
: ~'=>F2 z#45m$  
||wGs   
I% %JJ