GRAYBYTE WORDPRESS FILE MANAGER2821

Server IP : 149.255.58.128 / Your IP : 216.73.216.15
System : Linux cloud516.thundercloud.uk 5.14.0-427.26.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 17 15:51:13 EDT 2024 x86_64
PHP Version : 8.2.28
Disable Function : allow_url_include, apache_child_terminate, apache_setenv, exec, passthru, pcntl_exec, posix_kill, posix_mkfifo, posix_getpwuid, posix_setpgid, posix_setsid, posix_setuid, posix_setgid, posix_seteuid, posix_setegid, posix_uname, proc_close, proc_get_status, proc_open, proc_terminate, shell_exec, show_source, system
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /usr/lib64/python3.9/asyncio/__pycache__/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /usr/lib64/python3.9/asyncio/__pycache__//unix_events.cpython-39.pyc
a

�DOg*��@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZddl
mZddl
mZddl
mZddl
mZdd	l
mZdd
l
mZddl
mZddl
mZdd
l
mZddlmZdZe
jdkr�ed��dd�ZGdd�dej�ZGdd�dej �Z!Gdd�dej"ej#�Z$Gdd�dej%�Z&Gdd�d�Z'Gdd�de'�Z(d d!�Z)Gd"d#�d#e'�Z*Gd$d%�d%e*�Z+Gd&d'�d'e*�Z,Gd(d)�d)e'�Z-Gd*d+�d+e'�Z.Gd,d-�d-ej/�Z0eZ1e0Z2dS).z2Selector event loop for Unix with signal handling.�N�)�base_events)�base_subprocess)�	constants)�
coroutines)�events)�
exceptions)�futures)�selector_events)�tasks)�
transports)�logger)�SelectorEventLoop�AbstractChildWatcher�SafeChildWatcher�FastChildWatcher�PidfdChildWatcher�MultiLoopChildWatcher�ThreadedChildWatcher�DefaultEventLoopPolicy�win32z+Signals are not really supported on WindowscCsdS)zDummy signal handler.N�)�signum�framerr�+/usr/lib64/python3.9/asyncio/unix_events.py�_sighandler_noop*srcs�eZdZdZd)�fdd�	Z�fdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
d*dd�Zd+dd�Zd,dd�Z
dd�Zd-ddddd�dd�Zd.dddddd�dd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Z�ZS)/�_UnixSelectorEventLoopzdUnix event loop.

    Adds signal handling and UNIX Domain Socket support to SelectorEventLoop.
    Ncst��|�i|_dS�N)�super�__init__�_signal_handlers)�self�selector��	__class__rrr5sz_UnixSelectorEventLoop.__init__csZt���t��s.t|j�D]}|�|�qn(|jrVtjd|�d�t	|d�|j�
�dS)NzClosing the loop z@ on interpreter shutdown stage, skipping signal handlers removal��source)r�close�sys�
is_finalizing�listr �remove_signal_handler�warnings�warn�ResourceWarning�clear�r!�sigr#rrr'9s
�z_UnixSelectorEventLoop.closecCs|D]}|sq|�|�qdSr)�_handle_signal)r!�datarrrr�_process_self_dataGsz)_UnixSelectorEventLoop._process_self_datac
GsRt�|�st�|�rtd��|�|�|��zt�|j�	��Wn4t
tfyv}ztt
|���WYd}~n
d}~00t�|||d�}||j|<zt�|t�t�|d�Wn�t�yL}z�|j|=|j�szt�d�Wn6t
tf�y}zt�d|�WYd}~n
d}~00|jtjk�r6td|�d���n�WYd}~n
d}~00dS)z�Add a handler for a signal.  UNIX only.

        Raise ValueError if the signal number is invalid or uncatchable.
        Raise RuntimeError if there is a problem setting up the handler.
        z3coroutines cannot be used with add_signal_handler()NF����set_wakeup_fd(-1) failed: %s�sig � cannot be caught)rZiscoroutineZiscoroutinefunction�	TypeError�
_check_signal�
_check_closed�signal�
set_wakeup_fdZ_csock�fileno�
ValueError�OSError�RuntimeError�strr�Handler r�siginterruptr
�info�errno�EINVAL)r!r1�callback�args�exc�handleZnexcrrr�add_signal_handlerNs2
�
"
"z)_UnixSelectorEventLoop.add_signal_handlercCs8|j�|�}|durdS|jr*|�|�n
|�|�dS)z2Internal helper that is the actual signal handler.N)r �getZ
_cancelledr+Z_add_callback_signalsafe)r!r1rKrrrr2{sz%_UnixSelectorEventLoop._handle_signalc
Cs�|�|�z|j|=Wnty*YdS0|tjkr>tj}ntj}zt�||�WnDty�}z,|jtj	kr�t
d|�d���n�WYd}~n
d}~00|js�zt�d�Wn4ttfy�}zt
�d|�WYd}~n
d}~00dS)zwRemove a handler for a signal.  UNIX only.

        Return True if a signal handler was removed, False if not.
        Fr7r8Nr5r6T)r:r �KeyErrorr<�SIGINT�default_int_handler�SIG_DFLr@rFrGrAr=r?r
rE)r!r1�handlerrJrrrr+�s(

"z,_UnixSelectorEventLoop.remove_signal_handlercCs6t|t�std|����|t��vr2td|����dS)z�Internal helper to validate a signal.

        Raise ValueError if the signal number is invalid or uncatchable.
        Raise RuntimeError if there is a problem setting up the handler.
        zsig must be an int, not zinvalid signal number N)�
isinstance�intr9r<�
valid_signalsr?r0rrrr:�s
z$_UnixSelectorEventLoop._check_signalcCst|||||�Sr)�_UnixReadPipeTransport�r!�pipe�protocol�waiter�extrarrr�_make_read_pipe_transport�sz0_UnixSelectorEventLoop._make_read_pipe_transportcCst|||||�Sr)�_UnixWritePipeTransportrWrrr�_make_write_pipe_transport�sz1_UnixSelectorEventLoop._make_write_pipe_transportc	

�s�t����}
|
��std��|��}t||||||||f||d�|	��}|
�|��|j|�z|IdHWn@t	t
fy��Yn*ty�|��|�
�IdH�Yn0Wd�n1s�0Y|S)NzRasyncio.get_child_watcher() is not activated, subprocess support is not installed.)rZr[)r�get_child_watcher�	is_activerA�
create_future�_UnixSubprocessTransport�add_child_handlerZget_pid�_child_watcher_callback�
SystemExit�KeyboardInterrupt�
BaseExceptionr'�_wait)
r!rYrI�shell�stdin�stdout�stderr�bufsizer[�kwargs�watcherrZ�transprrr�_make_subprocess_transport�s.

���
�&z1_UnixSelectorEventLoop._make_subprocess_transportcCs|�|j|�dSr)�call_soon_threadsafeZ_process_exited)r!�pid�
returncoderprrrrd�sz._UnixSelectorEventLoop._child_watcher_callback)�ssl�sock�server_hostname�ssl_handshake_timeoutc	�s |dust|t�sJ�|r,|durLtd��n |dur<td��|durLtd��|dur�|durdtd��t�|�}t�tjtjd�}z |�d�|�	||�IdHWq�|�
��Yq�0n@|dur�td��|jtjks�|jtjkr�td|����|�d�|j
|||||d	�IdH\}}||fS)
Nz/you have to pass server_hostname when using sslz+server_hostname is only meaningful with ssl�1ssl_handshake_timeout is only meaningful with ssl�3path and sock can not be specified at the same timerFzno path and sock were specified�.A UNIX Domain Stream Socket was expected, got )rx)rSrBr?�os�fspath�socket�AF_UNIX�SOCK_STREAM�setblockingZsock_connectr'�family�typeZ_create_connection_transport)	r!�protocol_factory�pathrurvrwrx�	transportrYrrr�create_unix_connection�sN���



��
�z-_UnixSelectorEventLoop.create_unix_connection�dT)rv�backlogrurx�
start_servingc
�s�t|t�rtd��|dur&|s&td��|du�rJ|dur@td��t�|�}t�tjtj�}|ddvr�z t	�
t�	|�j�r�t�|�WnBt
y�Yn2ty�}zt�d||�WYd}~n
d}~00z|�|�Wnnt�y2}	z@|��|	jtjk�rd|�d�}
ttj|
�d�n�WYd}	~	nd}	~	0|���Yn0n<|du�r\td	��|jtjk�sx|jtjk�r�td
|����|�d�t�||g||||�}|�r�|��t�d�IdH|S)Nz*ssl argument must be an SSLContext or Noneryrzr)r�z2Unable to check or remove stale UNIX socket %r: %rzAddress z is already in usez-path was not specified, and no sock specifiedr{F)rS�boolr9r?r|r}r~rr��stat�S_ISSOCK�st_mode�remove�FileNotFoundErrorr@r
�error�bindr'rFZ
EADDRINUSEr�r�r�rZServerZ_start_servingr�sleep)r!r�r�rvr�rurxr��errrJ�msgZserverrrr�create_unix_serversh
�
�
�

�
��
�z)_UnixSelectorEventLoop.create_unix_serverc

�s�z
tjWnty&t�d��Yn0z|��}Wn4ttjfyh}zt�d��WYd}~n
d}~00zt�|�j	}Wnt
y�t�d��Yn0|r�|n|}|s�dS|��}	|�|	d|||||d�|	IdHS)Nzos.sendfile() is not availableznot a regular filer)
r|�sendfile�AttributeErrorr�SendfileNotAvailableErrorr>�io�UnsupportedOperation�fstat�st_sizer@ra�_sock_sendfile_native_impl)
r!rv�file�offset�countr>r��fsize�	blocksize�futrrr�_sock_sendfile_nativeJs,
�
 �z,_UnixSelectorEventLoop._sock_sendfile_nativec	Cs,|��}	|dur|�|�|��r4|�|||�dS|rd||}|dkrd|�|||�|�|�dSzt�|	|||�}
W�nDttfy�|dur�|�	||�|�
|	|j||	||||||�
Y�ndt�yj}z�|du�r|j
t
jk�rt|�tu�rtdt
j�}||_|}|dk�r>t�d�}
|�|||�|�|
�n|�|||�|�|�WYd}~n�d}~0ttf�y��Yn�t�y�}z$|�|||�|�|�WYd}~nrd}~00|
dk�r�|�|||�|�|�nD||
7}||
7}|du�r
|�	||�|�
|	|j||	||||||�
dS)Nrzsocket is not connectedzos.sendfile call failed)r>�
remove_writer�	cancelled�_sock_sendfile_update_filepos�
set_resultr|r��BlockingIOError�InterruptedError�_sock_add_cancellation_callbackZ
add_writerr�r@rFZENOTCONNr��ConnectionError�	__cause__rr��
set_exceptionrerfrg)r!r�Z
registered_fdrvr>r�r�r��
total_sent�fd�sentrJ�new_excr�rrrr�asp

�


�
��
� 

�z1_UnixSelectorEventLoop._sock_sendfile_native_implcCs|dkrt�||tj�dS�Nr)r|�lseek�SEEK_SET)r!r>r�r�rrrr��sz4_UnixSelectorEventLoop._sock_sendfile_update_fileposcs��fdd�}|�|�dS)Ncs&|��r"���}|dkr"��|�dS)Nr5)r�r>r�)r�r��r!rvrr�cb�szB_UnixSelectorEventLoop._sock_add_cancellation_callback.<locals>.cb)�add_done_callback)r!r�rvr�rr�rr��sz6_UnixSelectorEventLoop._sock_add_cancellation_callback)N)NN)NN)N)N)N)�__name__�
__module__�__qualname__�__doc__rr'r4rLr2r+r:r\r^rqrdr�r�r�r�r�r��
__classcell__rrr#rr/sB-
 �
�
�
��.��CFrcs�eZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Ze
jfdd�Zddd�Zdd�Zdd�Z�ZS) rViNcs�t��|�||jd<||_||_|��|_||_d|_d|_	t
�|j�j}t
�|�s�t
�|�s�t
�|�s�d|_d|_d|_td��t
�|jd�|j�|jj|�|j�|jj|j|j�|dur�|j�tj|d�dS)NrXFz)Pipe transport is for pipes/sockets only.)rr�_extra�_loop�_piper>�_fileno�	_protocol�_closing�_pausedr|r�r�r��S_ISFIFOr��S_ISCHRr?�set_blocking�	call_soon�connection_made�_add_reader�_read_readyr	�_set_result_unless_cancelled)r!�looprXrYrZr[�moder#rrr�s6


���
�z_UnixReadPipeTransport.__init__cCs�|jjg}|jdur |�d�n|jr0|�d�|�d|j���t|jdd�}|jdur�|dur�t�	||jt
j�}|r�|�d�q�|�d�n |jdur�|�d�n
|�d�d�d	�
|��S)
N�closed�closing�fd=�	_selector�polling�idle�open�<{}>� )r$r�r��appendr�r��getattrr�r
�_test_selector_event�	selectors�
EVENT_READ�format�join)r!rEr"r�rrr�__repr__�s$



�

z_UnixReadPipeTransport.__repr__c
Cs�zt�|j|j�}WnDttfy*Yn�tyX}z|�|d�WYd}~nfd}~00|rl|j�	|�nJ|j
��r�t�
d|�d|_|j
�|j�|j
�|jj�|j
�|jd�dS)Nz"Fatal read error on pipe transport�%r was closed by peerT)r|�readr��max_sizer�r�r@�_fatal_errorr�Z
data_receivedr��	get_debugr
rEr��_remove_readerr�Zeof_received�_call_connection_lost)r!r3rJrrrr��s"
z"_UnixReadPipeTransport._read_readycCs>|js|jrdSd|_|j�|j�|j��r:t�d|�dS)NTz%r pauses reading)r�r�r�r�r�r�r
�debug�r!rrr�
pause_reading�s
z$_UnixReadPipeTransport.pause_readingcCsB|js|jsdSd|_|j�|j|j�|j��r>t�d|�dS)NFz%r resumes reading)	r�r�r�r�r�r�r�r
r�r�rrr�resume_readings
z%_UnixReadPipeTransport.resume_readingcCs
||_dSr�r��r!rYrrr�set_protocol
sz#_UnixReadPipeTransport.set_protocolcCs|jSrr�r�rrr�get_protocolsz#_UnixReadPipeTransport.get_protocolcCs|jSr�r�r�rrr�
is_closingsz!_UnixReadPipeTransport.is_closingcCs|js|�d�dSr)r��_closer�rrrr'sz_UnixReadPipeTransport.closecCs,|jdur(|d|��t|d�|j��dS�Nzunclosed transport r%�r�r.r'�r!�_warnrrr�__del__s
z_UnixReadPipeTransport.__del__�Fatal error on pipe transportcCsZt|t�r4|jtjkr4|j��rLtjd||dd�n|j�||||j	d��|�
|�dS�Nz%r: %sT��exc_info)�message�	exceptionr�rY)rSr@rFZEIOr�r�r
r��call_exception_handlerr�r��r!rJr�rrrr�s
�z#_UnixReadPipeTransport._fatal_errorcCs(d|_|j�|j�|j�|j|�dS�NT)r�r�r�r�r�r��r!rJrrrr�-sz_UnixReadPipeTransport._closecCsPz,|j�|�W|j��d|_d|_d|_n|j��d|_d|_d|_0dSr�r�Zconnection_lostr�r'r�rrrrr�2s
�
z,_UnixReadPipeTransport._call_connection_lost)NN)r�)r�r�r�r�rr�r�r�r�r�r�r�r'r,r-r�r�r�r�r�rrr#rrV�s
rVcs�eZdZd%�fdd�	Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zejfdd�Zdd�Zd&dd �Zd'd!d"�Zd#d$�Z�ZS)(r]Nc
s�t��||�||jd<||_|��|_||_t�|_d|_	d|_
t�|j�j
}t�|�}t�|�}t�|�}	|s�|s�|	s�d|_d|_d|_td��t�|jd�|j�|jj|�|	s�|r�tj�d�s�|j�|jj|j|j�|dur�|j�tj|d�dS)NrXrFz?Pipe transport is only for pipes, sockets and character devicesZaix)rrr�r�r>r�r��	bytearray�_buffer�
_conn_lostr�r|r�r�r�r�r�r�r?r�r�r�r�r(�platform�
startswithr�r�r	r�)
r!r�rXrYrZr[r�Zis_char�is_fifo�	is_socketr#rrr?s6




�
�z _UnixWritePipeTransport.__init__cCs�|jjg}|jdur |�d�n|jr0|�d�|�d|j���t|jdd�}|jdur�|dur�t�	||jt
j�}|r�|�d�n
|�d�|��}|�d|���n |jdur�|�d�n
|�d�d	�
d
�|��S)Nr�r�r�r�r�r�zbufsize=r�r�r�)r$r�r�r�r�r�r�r�r
r�r��EVENT_WRITE�get_write_buffer_sizer�r�)r!rEr"r�rmrrrr�ds(



�


z _UnixWritePipeTransport.__repr__cCs
t|j�Sr)�lenrr�rrrr|sz-_UnixWritePipeTransport.get_write_buffer_sizecCs6|j��rt�d|�|jr*|�t��n|��dS)Nr�)r�r�r
rErr��BrokenPipeErrorr�rrrr�s

z#_UnixWritePipeTransport._read_readyc
CsLt|tttf�sJt|���t|t�r.t|�}|s6dS|jsB|jrj|jtjkrXt	�
d�|jd7_dS|j�s2zt�
|j|�}Wnnttfy�d}YnVttfy��Yn@ty�}z(|jd7_|�|d�WYd}~dSd}~00|t|�k�rdS|dk�r t|�|d�}|j�|j|j�|j|7_|��dS)Nz=pipe closed by peer or os.write(pipe, data) raised exception.rr�#Fatal write error on pipe transport)rS�bytesr�
memoryview�reprrr�rZ!LOG_THRESHOLD_FOR_CONNLOST_WRITESr
�warningrr|�writer�r�r�rerfrgr�r
r�Z_add_writer�_write_readyZ_maybe_pause_protocol)r!r3�nrJrrrr�s8


z_UnixWritePipeTransport.writec
Cs|jsJd��zt�|j|j�}Wn�ttfy8Yn�ttfyN�Yn�ty�}z>|j�	�|j
d7_
|j�|j�|�
|d�WYd}~npd}~00|t|j�kr�|j�	�|j�|j�|��|jr�|j�|j�|�d�dS|dk�r
|jd|�=dS)NzData should not be emptyrrr)rr|rr�r�r�rerfrgr/rr��_remove_writerr�r
Z_maybe_resume_protocolr�r�r�)r!rrJrrrr�s,
"


z$_UnixWritePipeTransport._write_readycCsdSrrr�rrr�
can_write_eof�sz%_UnixWritePipeTransport.can_write_eofcCsB|jr
dS|jsJ�d|_|js>|j�|j�|j�|jd�dSr)r�r�rr�r�r�r�r�r�rrr�	write_eof�s
z!_UnixWritePipeTransport.write_eofcCs
||_dSrr�r�rrrr��sz$_UnixWritePipeTransport.set_protocolcCs|jSrr�r�rrrr��sz$_UnixWritePipeTransport.get_protocolcCs|jSrr�r�rrrr��sz"_UnixWritePipeTransport.is_closingcCs|jdur|js|��dSr)r�r�rr�rrrr'�sz_UnixWritePipeTransport.closecCs,|jdur(|d|��t|d�|j��dSr�r�r�rrrr��s
z_UnixWritePipeTransport.__del__cCs|�d�dSr)r�r�rrr�abort�sz_UnixWritePipeTransport.abortr�cCsNt|t�r(|j��r@tjd||dd�n|j�||||jd��|�|�dSr�)	rSr@r�r�r
r�r�r�r�rrrrr��s

�z$_UnixWritePipeTransport._fatal_errorcCsFd|_|jr|j�|j�|j��|j�|j�|j�|j|�dSr)	r�rr�rr�r/r�r�r�rrrrr��s
z_UnixWritePipeTransport._closecCsPz,|j�|�W|j��d|_d|_d|_n|j��d|_d|_d|_0dSrrrrrrr��s
�
z-_UnixWritePipeTransport._call_connection_lost)NN)r�)N)r�r�r�rr�rr�rrrrr�r�r�r'r,r-r�rr�r�r�r�rrr#rr]<s"%	#	

r]c@seZdZdd�ZdS)rbc		Ks�d}|tjkrt��\}}zhtj|f||||d|d�|��|_|durh|��t|��d|d�|j_	d}W|dur�|��|��n|dur�|��|��0dS)NF)rirjrkrl�universal_newlinesrm�wb)�	buffering)
�
subprocess�PIPEr~�
socketpair�Popen�_procr'r��detachrj)	r!rIrirjrkrlrmrnZstdin_wrrr�_starts,
���
�z_UnixSubprocessTransport._startN)r�r�r�r$rrrrrb	srbc@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)raHAbstract base class for monitoring child processes.

    Objects derived from this class monitor a collection of subprocesses and
    report their termination or interruption by a signal.

    New callbacks are registered with .add_child_handler(). Starting a new
    process must be done within a 'with' block to allow the watcher to suspend
    its activity until the new process if fully registered (this is needed to
    prevent a race condition in some implementations).

    Example:
        with watcher:
            proc = subprocess.Popen("sleep 1")
            watcher.add_child_handler(proc.pid, callback)

    Notes:
        Implementations of this class must be thread-safe.

        Since child watcher objects may catch the SIGCHLD signal and call
        waitpid(-1), there should be only one active object per process.
    cGs
t��dS)aRegister a new child handler.

        Arrange for callback(pid, returncode, *args) to be called when
        process 'pid' terminates. Specifying another callback for the same
        process replaces the previous handler.

        Note: callback() must be thread-safe.
        N��NotImplementedError�r!rsrHrIrrrrc9s	z&AbstractChildWatcher.add_child_handlercCs
t��dS)z�Removes the handler for process 'pid'.

        The function returns True if the handler was successfully removed,
        False if there was nothing to remove.Nr%�r!rsrrr�remove_child_handlerDsz)AbstractChildWatcher.remove_child_handlercCs
t��dS)z�Attach the watcher to an event loop.

        If the watcher was previously attached to an event loop, then it is
        first detached before attaching to the new loop.

        Note: loop may be None.
        Nr%�r!r�rrr�attach_loopLsz AbstractChildWatcher.attach_loopcCs
t��dS)zlClose the watcher.

        This must be called to make sure that any underlying resource is freed.
        Nr%r�rrrr'VszAbstractChildWatcher.closecCs
t��dS)z�Return ``True`` if the watcher is active and is used by the event loop.

        Return True if the watcher is installed and ready to handle process exit
        notifications.

        Nr%r�rrrr`]szAbstractChildWatcher.is_activecCs
t��dS)zdEnter the watcher's context and allow starting new processes

        This function must return selfNr%r�rrr�	__enter__fszAbstractChildWatcher.__enter__cCs
t��dS)zExit the watcher's contextNr%�r!�a�b�crrr�__exit__lszAbstractChildWatcher.__exit__N)r�r�r�r�rcr)r+r'r`r,r1rrrrr"s
	rc@sXeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)ra6Child watcher implementation using Linux's pid file descriptors.

    This child watcher polls process file descriptors (pidfds) to await child
    process termination. In some respects, PidfdChildWatcher is a "Goldilocks"
    child watcher implementation. It doesn't require signals or threads, doesn't
    interfere with any processes launched outside the event loop, and scales
    linearly with the number of subprocesses launched by the event loop. The
    main disadvantage is that pidfds are specific to Linux, and only work on
    recent (5.3+) kernels.
    cCsd|_i|_dSr�r��
_callbacksr�rrrr}szPidfdChildWatcher.__init__cCs|Srrr�rrrr,�szPidfdChildWatcher.__enter__cCsdSrr)r!�exc_type�	exc_value�
exc_tracebackrrrr1�szPidfdChildWatcher.__exit__cCs|jduo|j��Sr�r�Z
is_runningr�rrrr`�szPidfdChildWatcher.is_activecCs|�d�dSr�r+r�rrrr'�szPidfdChildWatcher.closecCsd|jdur$|dur$|jr$t�dt�|j��D] \}}}|j�|�t�|�q.|j�	�||_dS�NzCA loop is being detached from a child watcher with pending handlers)
r�r3r,r-�RuntimeWarning�valuesr�r|r'r/)r!r��pidfd�_rrrr+�s�
zPidfdChildWatcher.attach_loopcGsZ|j�|�}|dur*|d||f|j|<n,t�|�}|j�||j|�|||f|j|<dSr�)r3rMr|�
pidfd_openr�r��_do_wait)r!rsrHrI�existingr<rrrrc�s
z#PidfdChildWatcher.add_child_handlercCs~|j�|�\}}}|j�|�zt�|d�\}}Wn"tyTd}t�d|�Yn
0t	|�}t�
|�|||g|�R�dS)Nr�zJchild process pid %d exit status already read:  will report returncode 255)r3�popr�r�r|�waitpid�ChildProcessErrorr
r�_compute_returncoder')r!rsr<rHrIr=�statusrtrrrr?�s�

zPidfdChildWatcher._do_waitcCsFz|j�|�\}}}Wnty*YdS0|j�|�t�|�dS)NFT)r3rBrNr�r�r|r')r!rsr<r=rrrr)�s
z&PidfdChildWatcher.remove_child_handlerN)
r�r�r�r�rr,r1r`r'r+rcr?r)rrrrrqs	rcCs2t�|�rt�|�St�|�r*t�|�S|SdSr)r|�WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUS)rFrrrrE�s



rEc@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�BaseChildWatchercCsd|_i|_dSrr2r�rrrr�szBaseChildWatcher.__init__cCs|�d�dSrr8r�rrrr'�szBaseChildWatcher.closecCs|jduo|j��Srr7r�rrrr`�szBaseChildWatcher.is_activecCs
t��dSrr%)r!�expected_pidrrr�_do_waitpid�szBaseChildWatcher._do_waitpidcCs
t��dSrr%r�rrr�_do_waitpid_all�sz BaseChildWatcher._do_waitpid_allcCs~|dust|tj�sJ�|jdur<|dur<|jr<t�dt�|jdurT|j�t	j
�||_|durz|�t	j
|j�|�
�dSr9)rSrZAbstractEventLoopr�r3r,r-r:r+r<�SIGCHLDrL�	_sig_chldrNr*rrrr+�s�
zBaseChildWatcher.attach_loopc
Cs^z|��WnLttfy$�Yn6tyX}z|j�d|d��WYd}~n
d}~00dS)N�$Unknown exception in SIGCHLD handler)r�r�)rNrerfrgr�r�rrrrrP�s�zBaseChildWatcher._sig_chldN)
r�r�r�rr'r`rMrNr+rPrrrrrK�srKcsPeZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
�ZS)rad'Safe' child watcher implementation.

    This implementation avoids disrupting other code spawning processes by
    polling explicitly each process in the SIGCHLD handler instead of calling
    os.waitpid(-1).

    This is a safe solution but it has a significant overhead when handling a
    big number of children (O(n) each time SIGCHLD is raised)
    cs|j��t���dSr)r3r/rr'r�r#rrr'
s
zSafeChildWatcher.closecCs|Srrr�rrrr,szSafeChildWatcher.__enter__cCsdSrrr-rrrr1szSafeChildWatcher.__exit__cGs||f|j|<|�|�dSr)r3rMr'rrrrcsz"SafeChildWatcher.add_child_handlercCs(z|j|=WdSty"YdS0dS�NTF�r3rNr(rrrr)s
z%SafeChildWatcher.remove_child_handlercCst|j�D]}|�|�q
dSr�r*r3rMr(rrrrN$sz SafeChildWatcher._do_waitpid_allcCs�|dksJ�zt�|tj�\}}Wn&tyH|}d}t�d|�Yn.0|dkrVdSt|�}|j��rvt�	d||�z|j
�|�\}}Wn,ty�|j��r�tjd|dd�Yn0|||g|�R�dS)NrrA�8Unknown child process pid %d, will report returncode 255�$process %s exited with returncode %s�'Child watcher got an unexpected pid: %rTr�)
r|rC�WNOHANGrDr
rrEr�r�r�r3rBrN)r!rLrsrFrtrHrIrrrrM)s2�

�
�zSafeChildWatcher._do_waitpid)r�r�r�r�r'r,r1rcr)rNrMr�rrr#rrs
rcsTeZdZdZ�fdd�Z�fdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
�ZS)raW'Fast' child watcher implementation.

    This implementation reaps every terminated processes by calling
    os.waitpid(-1) directly, possibly breaking other code spawning processes
    and waiting for their termination.

    There is no noticeable overhead when handling a big number of children
    (O(1) each time a child terminates).
    cs$t���t��|_i|_d|_dSr�)rr�	threading�Lock�_lock�_zombies�_forksr�r#rrrVs

zFastChildWatcher.__init__cs"|j��|j��t���dSr)r3r/r\rr'r�r#rrr'\s

zFastChildWatcher.closecCs<|j�"|jd7_|Wd�S1s.0YdS)Nr)r[r]r�rrrr,aszFastChildWatcher.__enter__cCst|j�N|jd8_|js"|js2Wd�dSt|j�}|j��Wd�n1sZ0Yt�d|�dS)Nrz5Caught subprocesses termination from unknown pids: %s)r[r]r\rBr/r
r)r!r.r/r0Zcollateral_victimsrrrr1gs
(�zFastChildWatcher.__exit__c	Gs�|jsJd��|j�Pz|j�|�}Wn.tyT||f|j|<YWd�dS0Wd�n1sj0Y|||g|�R�dS)NzMust use the context manager)r]r[r\rBrNr3)r!rsrHrIrtrrrrcus2z"FastChildWatcher.add_child_handlercCs(z|j|=WdSty"YdS0dSrRrSr(rrrr)�s
z%FastChildWatcher.remove_child_handlerc	Cszt�dtj�\}}Wnty*YdS0|dkr8dSt|�}|j��z|j�|�\}}WnNty�|j	r�||j
|<|j��r�t
�d||�YWd�qd}Yn0|j��r�t
�d||�Wd�n1s�0Y|dur�t
�d||�q|||g|�R�qdS)Nr5rz,unknown process %s exited with returncode %srVz8Caught subprocess termination from unknown pid: %d -> %d)r|rCrXrDrEr[r3rBrNr]r\r�r�r
r�r)r!rsrFrtrHrIrrrrN�s:

�

�"�z FastChildWatcher._do_waitpid_all)r�r�r�r�rr'r,r1rcr)rNr�rrr#rrLs	rc@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)ra~A watcher that doesn't require running loop in the main thread.

    This implementation registers a SIGCHLD signal handler on
    instantiation (which may conflict with other code that
    install own handler for this signal).

    The solution is safe but it has a significant overhead when
    handling a big number of processes (*O(n)* each time a
    SIGCHLD is received).
    cCsi|_d|_dSr)r3�_saved_sighandlerr�rrrr�szMultiLoopChildWatcher.__init__cCs
|jduSr)r^r�rrrr`�szMultiLoopChildWatcher.is_activecCsT|j��|jdurdSt�tj�}||jkr:t�d�nt�tj|j�d|_dS)Nz+SIGCHLD handler was changed by outside code)	r3r/r^r<�	getsignalrOrPr
r)r!rRrrrr'�s


zMultiLoopChildWatcher.closecCs|Srrr�rrrr,�szMultiLoopChildWatcher.__enter__cCsdSrr�r!r4�exc_val�exc_tbrrrr1�szMultiLoopChildWatcher.__exit__cGs&t��}|||f|j|<|�|�dSr)r�get_running_loopr3rM)r!rsrHrIr�rrrrc�sz'MultiLoopChildWatcher.add_child_handlercCs(z|j|=WdSty"YdS0dSrRrSr(rrrr)�s
z*MultiLoopChildWatcher.remove_child_handlercCsN|jdurdSt�tj|j�|_|jdur<t�d�tj|_t�tjd�dS)NzaPrevious SIGCHLD handler was set by non-Python code, restore to default handler on watcher close.F)r^r<rOrPr
rrQrDr*rrrr+�s


z!MultiLoopChildWatcher.attach_loopcCst|j�D]}|�|�q
dSrrTr(rrrrNsz%MultiLoopChildWatcher._do_waitpid_allc	Cs�|dksJ�zt�|tj�\}}Wn*tyL|}d}t�d|�d}Yn0|dkrZdSt|�}d}z|j�|�\}}}Wn"t	y�tjd|dd�YnJ0|�
�r�t�d||�n0|r�|��r�t�d	||�|j
|||g|�R�dS)
NrrArUFTrWr��%Loop %r that handles pid %r is closedrV)r|rCrXrDr
rrEr3rBrN�	is_closedr�r�rr)	r!rLrsrFrtZ	debug_logr�rHrIrrrrMs8�
��z!MultiLoopChildWatcher._do_waitpidc	CsHz|��Wn6ttfy$�Yn tyBtjddd�Yn0dS)NrQTr�)rNrerfrgr
r)r!rrrrrrP)szMultiLoopChildWatcher._sig_chldN)r�r�r�r�rr`r'r,r1rcr)r+rNrMrPrrrrr�s%rc@sneZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	e
jfdd�Zdd�Z
dd�Zdd�Zdd�ZdS)raAThreaded child watcher implementation.

    The watcher uses a thread per process
    for waiting for the process finish.

    It doesn't require subscription on POSIX signal
    but a thread creation is not free.

    The watcher has O(1) complexity, its performance doesn't depend
    on amount of spawn processes.
    cCst�d�|_i|_dSr�)�	itertoolsr��_pid_counter�_threadsr�rrrr?szThreadedChildWatcher.__init__cCsdSrrr�rrrr`CszThreadedChildWatcher.is_activecCs|��dSr)�
_join_threadsr�rrrr'FszThreadedChildWatcher.closecCs.dd�t|j���D�}|D]}|��qdS)z%Internal: Join all non-daemon threadscSsg|]}|��r|js|�qSr)�is_alive�daemon��.0�threadrrr�
<listcomp>Ks�z6ThreadedChildWatcher._join_threads.<locals>.<listcomp>N)r*rhr;r�)r!�threadsrnrrrriIsz"ThreadedChildWatcher._join_threadscCs|Srrr�rrrr,PszThreadedChildWatcher.__enter__cCsdSrrr`rrrr1SszThreadedChildWatcher.__exit__cCs6dd�t|j���D�}|r2||j�d�t|d�dS)NcSsg|]}|��r|�qSr)rjrlrrrroWs�z0ThreadedChildWatcher.__del__.<locals>.<listcomp>z0 has registered but not finished child processesr%)r*rhr;r$r.)r!r�rprrrr�Vs�zThreadedChildWatcher.__del__cGsFt��}tj|jdt|j���||||fdd�}||j|<|��dS)Nzwaitpid-T)�target�namerIrk)	rrcrY�ThreadrM�nextrgrh�start)r!rsrHrIr�rnrrrrc^s
�
z&ThreadedChildWatcher.add_child_handlercCsdSrrr(rrrr)gsz)ThreadedChildWatcher.remove_child_handlercCsdSrrr*rrrr+msz ThreadedChildWatcher.attach_loopcCs�|dksJ�zt�|d�\}}Wn&tyF|}d}t�d|�Yn 0t|�}|��rft�d||�|��r~t�d||�n|j	|||g|�R�|j
�|�dS)NrrArUrVrd)r|rCrDr
rrEr�r�rerrrhrB)r!r�rLrHrIrsrFrtrrrrMps&�
�z ThreadedChildWatcher._do_waitpidN)r�r�r�r�rr`r'rir,r1r,r-r�rcr)r+rMrrrrr2s	rcsHeZdZdZeZ�fdd�Zdd�Z�fdd�Zdd	�Z	d
d�Z
�ZS)�_UnixDefaultEventLoopPolicyz:UNIX event loop policy with a watcher for child processes.cst���d|_dSr)rr�_watcherr�r#rrr�s
z$_UnixDefaultEventLoopPolicy.__init__cCs\tj�B|jdur:t�|_t��t��ur:|j�|jj	�Wd�n1sN0YdSr)
rr[rwrrY�current_thread�main_threadr+�_localr�r�rrr�
_init_watcher�s

z)_UnixDefaultEventLoopPolicy._init_watchercs6t��|�|jdur2t��t��ur2|j�|�dS)z�Set the event loop.

        As a side effect, if a child watcher was set before, then calling
        .set_event_loop() from the main thread will call .attach_loop(loop) on
        the child watcher.
        N)r�set_event_looprwrYrxryr+r*r#rrr|�s

�z*_UnixDefaultEventLoopPolicy.set_event_loopcCs|jdur|��|jS)z~Get the watcher for child processes.

        If not yet set, a ThreadedChildWatcher object is automatically created.
        N)rwr{r�rrrr_�s
z-_UnixDefaultEventLoopPolicy.get_child_watchercCs4|dust|t�sJ�|jdur*|j��||_dS)z$Set the watcher for child processes.N)rSrrwr')r!rorrr�set_child_watcher�s

z-_UnixDefaultEventLoopPolicy.set_child_watcher)r�r�r�r�rZ
_loop_factoryrr{r|r_r}r�rrr#rrv�s
rv)3r�rFr�rfr|r�r<r~r�rr(rYr,�rrrrrrr	r
rr�logr
�__all__r�ImportErrorrZBaseSelectorEventLooprZ
ReadTransportrVZ_FlowControlMixinZWriteTransportr]ZBaseSubprocessTransportrbrrrErKrrrrZBaseDefaultEventLoopPolicyrvrrrrrr�<module>sb	
	�NON5Ji}Y2

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
December 12 2024 22:42:25
0 / root
0755
__init__.cpython-39.opt-1.pyc
0.763 KB
December 12 2024 10:11:38
0 / root
0644
__init__.cpython-39.opt-2.pyc
0.708 KB
December 12 2024 10:11:38
0 / root
0644
__init__.cpython-39.pyc
0.763 KB
December 12 2024 10:11:38
0 / root
0644
__main__.cpython-39.opt-1.pyc
3.137 KB
December 12 2024 10:11:38
0 / root
0644
__main__.cpython-39.opt-2.pyc
3.137 KB
December 12 2024 10:11:38
0 / root
0644
__main__.cpython-39.pyc
3.137 KB
December 12 2024 10:11:38
0 / root
0644
base_events.cpython-39.opt-1.pyc
50.953 KB
December 12 2024 10:11:38
0 / root
0644
base_events.cpython-39.opt-2.pyc
42.136 KB
December 12 2024 10:11:38
0 / root
0644
base_events.cpython-39.pyc
51.074 KB
December 12 2024 10:11:38
0 / root
0644
base_futures.cpython-39.opt-1.pyc
1.865 KB
December 12 2024 10:11:38
0 / root
0644
base_futures.cpython-39.opt-2.pyc
1.617 KB
December 12 2024 10:11:38
0 / root
0644
base_futures.cpython-39.pyc
1.865 KB
December 12 2024 10:11:38
0 / root
0644
base_subprocess.cpython-39.opt-1.pyc
9.123 KB
December 12 2024 10:11:38
0 / root
0644
base_subprocess.cpython-39.opt-2.pyc
9.025 KB
December 12 2024 10:11:38
0 / root
0644
base_subprocess.cpython-39.pyc
9.191 KB
December 12 2024 10:11:38
0 / root
0644
base_tasks.cpython-39.opt-1.pyc
1.9 KB
December 12 2024 10:11:38
0 / root
0644
base_tasks.cpython-39.opt-2.pyc
1.9 KB
December 12 2024 10:11:38
0 / root
0644
base_tasks.cpython-39.pyc
1.9 KB
December 12 2024 10:11:38
0 / root
0644
constants.cpython-39.opt-1.pyc
0.569 KB
December 12 2024 10:11:38
0 / root
0644
constants.cpython-39.opt-2.pyc
0.569 KB
December 12 2024 10:11:38
0 / root
0644
constants.cpython-39.pyc
0.569 KB
December 12 2024 10:11:38
0 / root
0644
coroutines.cpython-39.opt-1.pyc
6.421 KB
December 12 2024 10:11:38
0 / root
0644
coroutines.cpython-39.opt-2.pyc
6.194 KB
December 12 2024 10:11:38
0 / root
0644
coroutines.cpython-39.pyc
6.483 KB
December 12 2024 10:11:38
0 / root
0644
events.cpython-39.opt-1.pyc
27.42 KB
December 12 2024 10:11:38
0 / root
0644
events.cpython-39.opt-2.pyc
18.536 KB
December 12 2024 10:11:38
0 / root
0644
events.cpython-39.pyc
27.5 KB
December 12 2024 10:11:38
0 / root
0644
exceptions.cpython-39.opt-1.pyc
2.495 KB
December 12 2024 10:11:38
0 / root
0644
exceptions.cpython-39.opt-2.pyc
1.866 KB
December 12 2024 10:11:38
0 / root
0644
exceptions.cpython-39.pyc
2.495 KB
December 12 2024 10:11:38
0 / root
0644
format_helpers.cpython-39.opt-1.pyc
2.271 KB
December 12 2024 10:11:38
0 / root
0644
format_helpers.cpython-39.opt-2.pyc
2.033 KB
December 12 2024 10:11:38
0 / root
0644
format_helpers.cpython-39.pyc
2.271 KB
December 12 2024 10:11:38
0 / root
0644
futures.cpython-39.opt-1.pyc
11.354 KB
December 12 2024 10:11:38
0 / root
0644
futures.cpython-39.opt-2.pyc
7.931 KB
December 12 2024 10:11:38
0 / root
0644
futures.cpython-39.pyc
11.502 KB
December 12 2024 10:11:38
0 / root
0644
locks.cpython-39.opt-1.pyc
14.127 KB
December 12 2024 10:11:38
0 / root
0644
locks.cpython-39.opt-2.pyc
8.036 KB
December 12 2024 10:11:38
0 / root
0644
locks.cpython-39.pyc
14.127 KB
December 12 2024 10:11:38
0 / root
0644
log.cpython-39.opt-1.pyc
0.223 KB
December 12 2024 10:11:38
0 / root
0644
log.cpython-39.opt-2.pyc
0.185 KB
December 12 2024 10:11:38
0 / root
0644
log.cpython-39.pyc
0.223 KB
December 12 2024 10:11:38
0 / root
0644
proactor_events.cpython-39.opt-1.pyc
23.619 KB
December 12 2024 10:11:38
0 / root
0644
proactor_events.cpython-39.opt-2.pyc
23.229 KB
December 12 2024 10:11:38
0 / root
0644
proactor_events.cpython-39.pyc
23.844 KB
December 12 2024 10:11:38
0 / root
0644
protocols.cpython-39.opt-1.pyc
8.239 KB
December 12 2024 10:11:38
0 / root
0644
protocols.cpython-39.opt-2.pyc
3.278 KB
December 12 2024 10:11:38
0 / root
0644
protocols.cpython-39.pyc
8.239 KB
December 12 2024 10:11:38
0 / root
0644
queues.cpython-39.opt-1.pyc
8.268 KB
December 12 2024 10:11:38
0 / root
0644
queues.cpython-39.opt-2.pyc
5.651 KB
December 12 2024 10:11:38
0 / root
0644
queues.cpython-39.pyc
8.268 KB
December 12 2024 10:11:38
0 / root
0644
runners.cpython-39.opt-1.pyc
2.157 KB
December 12 2024 10:11:38
0 / root
0644
runners.cpython-39.opt-2.pyc
1.491 KB
December 12 2024 10:11:38
0 / root
0644
runners.cpython-39.pyc
2.157 KB
December 12 2024 10:11:38
0 / root
0644
selector_events.cpython-39.opt-1.pyc
28.979 KB
December 12 2024 10:11:38
0 / root
0644
selector_events.cpython-39.opt-2.pyc
27.371 KB
December 12 2024 10:11:38
0 / root
0644
selector_events.cpython-39.pyc
29.021 KB
December 12 2024 10:11:38
0 / root
0644
sslproto.cpython-39.opt-1.pyc
21.215 KB
December 12 2024 10:11:38
0 / root
0644
sslproto.cpython-39.opt-2.pyc
14.427 KB
December 12 2024 10:11:38
0 / root
0644
sslproto.cpython-39.pyc
21.375 KB
December 12 2024 10:11:38
0 / root
0644
staggered.cpython-39.opt-1.pyc
3.915 KB
December 12 2024 10:11:38
0 / root
0644
staggered.cpython-39.opt-2.pyc
1.832 KB
December 12 2024 10:11:38
0 / root
0644
staggered.cpython-39.pyc
4.064 KB
December 12 2024 10:11:38
0 / root
0644
streams.cpython-39.opt-1.pyc
19.884 KB
December 12 2024 10:11:38
0 / root
0644
streams.cpython-39.opt-2.pyc
14.128 KB
December 12 2024 10:11:38
0 / root
0644
streams.cpython-39.pyc
20.105 KB
December 12 2024 10:11:38
0 / root
0644
subprocess.cpython-39.opt-1.pyc
7.151 KB
December 12 2024 10:11:38
0 / root
0644
subprocess.cpython-39.opt-2.pyc
7.026 KB
December 12 2024 10:11:38
0 / root
0644
subprocess.cpython-39.pyc
7.165 KB
December 12 2024 10:11:38
0 / root
0644
tasks.cpython-39.opt-1.pyc
23.681 KB
December 12 2024 10:11:38
0 / root
0644
tasks.cpython-39.opt-2.pyc
16.6 KB
December 12 2024 10:11:38
0 / root
0644
tasks.cpython-39.pyc
23.72 KB
December 12 2024 10:11:38
0 / root
0644
threads.cpython-39.opt-1.pyc
0.957 KB
December 12 2024 10:11:38
0 / root
0644
threads.cpython-39.opt-2.pyc
0.502 KB
December 12 2024 10:11:38
0 / root
0644
threads.cpython-39.pyc
0.957 KB
December 12 2024 10:11:38
0 / root
0644
transports.cpython-39.opt-1.pyc
12.229 KB
December 12 2024 10:11:38
0 / root
0644
transports.cpython-39.opt-2.pyc
6.809 KB
December 12 2024 10:11:38
0 / root
0644
transports.cpython-39.pyc
12.242 KB
December 12 2024 10:11:38
0 / root
0644
trsock.cpython-39.opt-1.pyc
8.37 KB
December 12 2024 10:11:38
0 / root
0644
trsock.cpython-39.opt-2.pyc
8.12 KB
December 12 2024 10:11:38
0 / root
0644
trsock.cpython-39.pyc
8.37 KB
December 12 2024 10:11:38
0 / root
0644
unix_events.cpython-39.opt-1.pyc
40.748 KB
December 12 2024 10:11:38
0 / root
0644
unix_events.cpython-39.opt-2.pyc
35.647 KB
December 12 2024 10:11:38
0 / root
0644
unix_events.cpython-39.pyc
41.061 KB
December 12 2024 10:11:38
0 / root
0644
windows_events.cpython-39.opt-1.pyc
24.138 KB
December 12 2024 10:11:38
0 / root
0644
windows_events.cpython-39.opt-2.pyc
23.057 KB
December 12 2024 10:11:38
0 / root
0644
windows_events.cpython-39.pyc
24.153 KB
December 12 2024 10:11:38
0 / root
0644
windows_utils.cpython-39.opt-1.pyc
4.333 KB
December 12 2024 10:11:38
0 / root
0644
windows_utils.cpython-39.opt-2.pyc
3.909 KB
December 12 2024 10:11:38
0 / root
0644
windows_utils.cpython-39.pyc
4.399 KB
December 12 2024 10:11:38
0 / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF