/usr/lib64/python3.9/asyncio/__pycache__
NameSizeModeActions
base_events.cpython-39.opt-1.pyc521760644editdlrm
base_events.cpython-39.opt-2.pyc431470644editdlrm
base_events.cpython-39.pyc523000644editdlrm
base_futures.cpython-39.opt-1.pyc19100644editdlrm
base_futures.cpython-39.opt-2.pyc16560644editdlrm
base_futures.cpython-39.pyc19100644editdlrm
base_subprocess.cpython-39.opt-1.pyc93420644editdlrm
base_subprocess.cpython-39.opt-2.pyc92420644editdlrm
base_subprocess.cpython-39.pyc94120644editdlrm
base_tasks.cpython-39.opt-1.pyc19460644editdlrm
base_tasks.cpython-39.opt-2.pyc19460644editdlrm
base_tasks.cpython-39.pyc19460644editdlrm
constants.cpython-39.opt-1.pyc5830644editdlrm
constants.cpython-39.opt-2.pyc5830644editdlrm
constants.cpython-39.pyc5830644editdlrm
coroutines.cpython-39.opt-1.pyc65750644editdlrm
coroutines.cpython-39.opt-2.pyc63430644editdlrm
coroutines.cpython-39.pyc66390644editdlrm
events.cpython-39.opt-1.pyc280780644editdlrm
events.cpython-39.opt-2.pyc189810644editdlrm
events.cpython-39.pyc281600644editdlrm
exceptions.cpython-39.opt-1.pyc25550644editdlrm
exceptions.cpython-39.opt-2.pyc19110644editdlrm
exceptions.cpython-39.pyc25550644editdlrm
format_helpers.cpython-39.opt-1.pyc23260644editdlrm
format_helpers.cpython-39.opt-2.pyc20820644editdlrm
format_helpers.cpython-39.pyc23260644editdlrm
futures.cpython-39.opt-1.pyc116270644editdlrm
futures.cpython-39.opt-2.pyc81210644editdlrm
futures.cpython-39.pyc117780644editdlrm
locks.cpython-39.opt-1.pyc144660644editdlrm
locks.cpython-39.opt-2.pyc82290644editdlrm
locks.cpython-39.pyc144660644editdlrm
log.cpython-39.opt-1.pyc2280644editdlrm
log.cpython-39.opt-2.pyc1890644editdlrm
log.cpython-39.pyc2280644editdlrm
proactor_events.cpython-39.opt-1.pyc241860644editdlrm
proactor_events.cpython-39.opt-2.pyc237860644editdlrm
proactor_events.cpython-39.pyc244160644editdlrm
protocols.cpython-39.opt-1.pyc84370644editdlrm
protocols.cpython-39.opt-2.pyc33570644editdlrm
protocols.cpython-39.pyc84370644editdlrm
queues.cpython-39.opt-1.pyc84660644editdlrm
queues.cpython-39.opt-2.pyc57870644editdlrm
queues.cpython-39.pyc84660644editdlrm
runners.cpython-39.opt-1.pyc22090644editdlrm
runners.cpython-39.opt-2.pyc15270644editdlrm
runners.cpython-39.pyc22090644editdlrm
selector_events.cpython-39.opt-1.pyc296740644editdlrm
selector_events.cpython-39.opt-2.pyc280280644editdlrm
selector_events.cpython-39.pyc297180644editdlrm
sslproto.cpython-39.opt-1.pyc217240644editdlrm
sslproto.cpython-39.opt-2.pyc147730644editdlrm
sslproto.cpython-39.pyc218880644editdlrm
staggered.cpython-39.opt-1.pyc40090644editdlrm
staggered.cpython-39.opt-2.pyc18760644editdlrm
staggered.cpython-39.pyc41620644editdlrm
streams.cpython-39.opt-1.pyc203610644editdlrm
streams.cpython-39.opt-2.pyc144670644editdlrm
streams.cpython-39.pyc205880644editdlrm
subprocess.cpython-39.opt-1.pyc73230644editdlrm
subprocess.cpython-39.opt-2.pyc71950644editdlrm
subprocess.cpython-39.pyc73370644editdlrm
tasks.cpython-39.opt-1.pyc242490644editdlrm
tasks.cpython-39.opt-2.pyc169980644editdlrm
tasks.cpython-39.pyc242890644editdlrm
threads.cpython-39.opt-1.pyc9800644editdlrm
threads.cpython-39.opt-2.pyc5140644editdlrm
threads.cpython-39.pyc9800644editdlrm
transports.cpython-39.opt-1.pyc125220644editdlrm
transports.cpython-39.opt-2.pyc69720644editdlrm
transports.cpython-39.pyc125360644editdlrm
trsock.cpython-39.opt-1.pyc85710644editdlrm
trsock.cpython-39.opt-2.pyc83150644editdlrm
trsock.cpython-39.pyc85710644editdlrm
unix_events.cpython-39.opt-1.pyc417260644editdlrm
unix_events.cpython-39.opt-2.pyc365030644editdlrm
unix_events.cpython-39.pyc420460644editdlrm
windows_events.cpython-39.opt-1.pyc247170644editdlrm
windows_events.cpython-39.opt-2.pyc236100644editdlrm
windows_events.cpython-39.pyc247330644editdlrm
windows_utils.cpython-39.opt-1.pyc44370644editdlrm
windows_utils.cpython-39.opt-2.pyc40030644editdlrm
windows_utils.cpython-39.pyc45050644editdlrm
__init__.cpython-39.opt-1.pyc7810644editdlrm
__init__.cpython-39.opt-2.pyc7250644editdlrm
__init__.cpython-39.pyc7810644editdlrm
__main__.cpython-39.opt-1.pyc32120644editdlrm
__main__.cpython-39.opt-2.pyc32120644editdlrm
__main__.cpython-39.pyc32120644editdlrm
Edit: /usr/lib64/python3.9/asyncio/__pycache__/base_events.cpython-39.pyc (52300B)
a ´iÐ!ã@sìdZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZz ddlZWney¦dZYn0ddlmZddlmZddlmZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZddl m!Z!dZ"dZ#dZ$e%e dƒZ&dZ'e(ƒZ)dd„Z*dd„Z+dd„Z,d-dd„Z-d.dd„Z.dd „Z/e%e d!ƒ�r¢d"d#„Z0nd$d#„Z0d%d&„Z1Gd'd(„d(ej2ƒZ3Gd)d*„d*ej4ƒZ5Gd+d,„d,ej6ƒZ7dS)/a™Base implementation of event loop. The event loop can be broken up into a multiplexer (the part responsible for notifying us of I/O events) and the event loop proper, which wraps a multiplexer with functionality for scheduling callbacks, immediately or at a given time in the future. Whenever a public API takes a callback, subsequent positional arguments will be passed to the callback if/when it is called. This avoids the proliferation of trivial lambdas implementing closures. Keyword arguments for the callback are not supported; this is a conscious design decision, leaving the door open for keyword arguments to modify the meaning of the API call itself. éNé)Ú constants)Ú coroutines)Úevents)Ú exceptions)Úfutures)Ú protocols)Ússlproto)Ú staggered)Útasks)Ú transports)Útrsock)Úlogger)Ú BaseEventLoopÚServerédgà?ÚAF_INET6i€QcCs0|j}tt|ddƒtjƒr$t|jƒSt|ƒSdS)NÚ__self__)Ú _callbackÚ isinstanceÚgetattrr ÚTaskÚreprrÚstr)ÚhandleÚcb©rú+/usr/lib64/python3.9/asyncio/base_events.pyÚ_format_handleJs rcCs(|tjkrdS|tjkrdSt|ƒSdS)Nzz)Ú subprocessÚPIPEÚSTDOUTr)ÚfdrrrÚ _format_pipeSs   r#cCsJttdƒstdƒ‚n2z| tjtjd¡WntyDtdƒ‚Yn0dS)NÚ SO_REUSEPORTz)reuse_port not supported by socket modulerzTreuse_port not supported by socket module, SO_REUSEPORT defined but not implemented.)ÚhasattrÚsocketÚ ValueErrorÚ setsockoptÚ SOL_SOCKETr$ÚOSError©ÚsockrrrÚ_set_reuseport\s    r-c Cs€ttdƒsdS|dtjtjhvs(|dur,dS|tjkr>tj}n|tjkrPtj}ndS|durbd}nVt|tƒrz|dkrzd}n>t|tƒr’|dkr’d}n&z t |ƒ}Wnt t fy¶YdS0|tj krÜtj g}trâ| tj¡n|g}t|tƒrö| d¡}d|v�rdS|D]r}zVt ||¡t�rH|tjk�rH|||d||||ffWS|||d||ffWSWnt�yvYn0�qdS)NÚ inet_ptonróÚZidnaú%)r%r&Ú IPPROTO_TCPÚ IPPROTO_UDPÚ SOCK_STREAMÚ SOCK_DGRAMrÚbytesrÚintÚ TypeErrorr'Ú AF_UNSPECÚAF_INETÚ _HAS_IPv6ÚappendrÚdecoder.r*) ÚhostÚportÚfamilyÚtypeÚprotoZflowinfoZscopeidZafsÚafrrrÚ _ipaddr_infogsN ÿ         rDcCs¢t ¡}|D]*}|d}||vr(g||<|| |¡q t| ¡ƒ}g}|dkr|| |dd|d…¡|dd|d…=| dd„tj tj |Ž¡Dƒ¡|S)z-Interleave list of addrinfo tuples by family.rrNcss|]}|dur|VqdS©Nr)Ú.0ÚarrrÚ ±sþz(_interleave_addrinfos..) Ú collectionsÚ OrderedDictr<ÚlistÚvaluesÚextendÚ itertoolsÚchainÚ from_iterableÚ zip_longest)Z addrinfosZfirst_address_family_countZaddrinfos_by_familyÚaddrr@Zaddrinfos_listsZ reorderedrrrÚ_interleave_addrinfos¢s"  ÿÿrScCs4| ¡s"| ¡}t|ttfƒr"dSt |¡ ¡dSrE)Ú cancelledÚ exceptionrÚ SystemExitÚKeyboardInterruptrZ _get_loopÚstop)ÚfutÚexcrrrÚ_run_until_complete_cb¸s r[Ú TCP_NODELAYcCs@|jtjtjhvr<|jtjkr<|jtjkr<| tjtj d¡dS©Nr) r@r&r:rrAr4rBr2r(r\r+rrrÚ _set_nodelayÃs  ÿ þr^cCsdSrErr+rrrr^ÉscCs tdurt|tjƒrtdƒ‚dS)Nz"Socket cannot be of type SSLSocket)ÚsslrZ SSLSocketr8r+rrrÚ_check_ssl_socketÍsr`c@sTeZdZdd„Zdd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dS)Ú_SendfileFallbackProtocolcCsht|tjƒstdƒ‚||_| ¡|_| ¡|_|j |_ |  ¡|  |¡|j r^|jj  ¡|_nd|_dS)Nz.transport should be _FlowControlMixin instance)rr Z_FlowControlMixinr8Ú _transportZ get_protocolÚ_protoZ is_readingÚ_should_resume_readingZ_protocol_pausedÚ_should_resume_writingÚ pause_readingÚ set_protocolÚ_loopÚ create_futureÚ_write_ready_fut)ÚselfÚtransprrrÚ__init__Ós    z"_SendfileFallbackProtocol.__init__cÃs2|j ¡rtdƒ‚|j}|dur$dS|IdHdS)NzConnection closed by peer)rbÚ is_closingÚConnectionErrorrj)rkrYrrrÚdrainás  z_SendfileFallbackProtocol.draincCs tdƒ‚dS)Nz?Invalid state: connection should have been established already.©Ú RuntimeError)rkÚ transportrrrÚconnection_madeész)_SendfileFallbackProtocol.connection_madecCs@|jdur0|dur$|j tdƒ¡n |j |¡|j |¡dS)NzConnection is closed by peer)rjÚ set_exceptionrorcÚconnection_lost)rkrZrrrrvís ÿ z)_SendfileFallbackProtocol.connection_lostcCs |jdurdS|jj ¡|_dSrE)rjrbrhri©rkrrrÚ pause_writingøs z'_SendfileFallbackProtocol.pause_writingcCs$|jdurdS|j d¡d|_dS)NF)rjÚ set_resultrwrrrÚresume_writingýs  z(_SendfileFallbackProtocol.resume_writingcCs tdƒ‚dS©Nz'Invalid state: reading should be pausedrq)rkÚdatarrrÚ data_receivedsz'_SendfileFallbackProtocol.data_receivedcCs tdƒ‚dSr{rqrwrrrÚ eof_receivedsz&_SendfileFallbackProtocol.eof_receivedcÃsF|j |j¡|jr|j ¡|jdur2|j ¡|jrB|j ¡dSrE) rbrgrcrdÚresume_readingrjÚcancelrerzrwrrrÚrestore s   z!_SendfileFallbackProtocol.restoreN) Ú__name__Ú __module__Ú __qualname__rmrprtrvrxrzr}r~r�rrrrraÒs rac@sxeZdZdd„Zdd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z e dd„ƒZ dd„Z dd„Zdd„Zdd„ZdS)rcCs@||_||_d|_g|_||_||_||_||_d|_d|_ dS)NrF) rhÚ_socketsÚ _active_countÚ_waitersÚ_protocol_factoryÚ_backlogÚ _ssl_contextÚ_ssl_handshake_timeoutÚ_servingÚ_serving_forever_fut)rkÚloopÚsocketsÚprotocol_factoryZ ssl_contextÚbacklogÚssl_handshake_timeoutrrrrmszServer.__init__cCsd|jj›d|j›d�S)Nú)Ú __class__r‚r�rwrrrÚ__repr__%szServer.__repr__cCs |jdusJ‚|jd7_dSr])r…r†rwrrrÚ_attach(szServer._attachcCs<|jdksJ‚|jd8_|jdkr8|jdur8| ¡dS)Nrr)r†r…Ú_wakeuprwrrrÚ_detach,szServer._detachcCs,|j}d|_|D]}| ¡s| |¡qdSrE)r‡Údonery)rkÚwaitersÚwaiterrrrr˜2s zServer._wakeupc CsJ|jr dSd|_|jD].}| |j¡|j |j||j||j|j¡qdS)NT) rŒr…Úlistenr‰rhÚ_start_servingrˆrŠr‹)rkr,rrrrž9s    þzServer._start_servingcCs|jSrE)rhrwrrrÚget_loopCszServer.get_loopcCs|jSrE)rŒrwrrrÚ is_servingFszServer.is_servingcCs"|jdurdStdd„|jDƒƒS)Nrcss|]}t |¡VqdSrE)r ZTransportSocket)rFÚsrrrrHMr/z!Server.sockets..)r…Útuplerwrrrr�Is zServer.socketscCsn|j}|durdSd|_|D]}|j |¡qd|_|jdurX|j ¡sX|j ¡d|_|jdkrj| ¡dS)NFr) r…rhZ _stop_servingrŒr�ršr€r†r˜)rkr�r,rrrÚcloseOs ÿ  z Server.closecÃs| ¡t d¡IdHdS)Nr)ržr ÚsleeprwrrrÚ start_servingbszServer.start_servingc Ãs¨|jdurtd|›d�ƒ‚|jdur4td|›d�ƒ‚| ¡|j ¡|_zRz|jIdHWn6tjy�z| ¡|  ¡IdHW‚n‚0Yn0Wd|_nd|_0dS)Nzserver z, is already being awaited on serve_forever()z is closed) r�rrr…ržrhrirÚCancelledErrorr£Ú wait_closedrwrrrÚ serve_foreverhs   ÿ  zServer.serve_forevercÃs<|jdus|jdurdS|j ¡}|j |¡|IdHdSrE)r…r‡rhrir<)rkrœrrrr§}s   zServer.wait_closedN)r‚rƒr„rmr–r—r™r˜ržrŸr Úpropertyr�r£r¥r¨r§rrrrrs   rc @sheZdZdd„Zdd„Zdd„Zddœd d „Zd d „Zd d„Zd¦dddœdd„Z d§dddddddœdd„Z d¨dd„Z d©dd„Z dªdd„Z d«dd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„Zd1d2„Zd3d4„Zd5d6„Zd7d8„Zd9d:„Zd;d<„Zejfd=d>„Z d?d@„Z!dAdB„Z"ddCœdDdE„Z#ddCœdFdG„Z$ddCœdHdI„Z%dJdK„Z&dLdM„Z'dNdO„Z(ddCœdPdQ„Z)dRdS„Z*dTdU„Z+dVdW„Z,dXdXdXdXdYœdZd[„Z-d¬d\d]„Z.d­dd^œd_d`„Z/dadb„Z0dcdd„Z1dedf„Z2d®dgdh„Z3d¯ddXdXdXdddddddiœ djdk„Z4d°dldm„Z5d±dd^œdndo„Z6dpdq„Z7drds„Z8ddddtœdudv„Z9d²dXdXdXe:ddddwœdxdy„Z;dXed|d}„Z?d³e$r/z4BaseEventLoop.shutdown_asyncgens..)Zreturn_exceptionsrŽz;an error occurred during closing of asynchronous generator )ÚmessagerUZasyncgen) rÀÚlenr¿rKÚclearr Ú_gatherÚziprÚ ExceptionÚcall_exception_handler)rkZ closing_agensÚresultsÚresultròrrrÚshutdown_asyncgenss&    ý ÿüz BaseEventLoop.shutdown_asyncgenscÃs\d|_|jdurdS| ¡}tj|j|fd�}| ¡z|IdHW| ¡n | ¡0dS)z.Schedule the shutdown of the default executor.TN)Útargetrâ)rÁr±riÚ threadingÚThreadÚ _do_shutdownÚstartÚjoin)rkÚfutureÚthreadrrrÚshutdown_default_executor1s  z'BaseEventLoop.shutdown_default_executorc CsXz |jjdd�| |jd¡Wn2tyR}z| |j|¡WYd}~n d}~00dS)NT©Úwait)r±Úshutdownrïryrru)rkr Úexrrrr >s zBaseEventLoop._do_shutdowncCs(| ¡rtdƒ‚t ¡dur$tdƒ‚dS)Nz"This event loop is already runningz7Cannot run the event loop while another loop is running)rÂrrrZ_get_running_looprwrrrÚ_check_runningEs  ÿzBaseEventLoop._check_runningc Cs¼| ¡| ¡| |j¡t ¡|_t ¡}tj |j |j d�zJt   |¡| ¡|jrLq^qLWd|_d|_t   d¡| d¡tj |Žn,d|_d|_t   d¡| d¡tj |Ž0dS)zRun until stop() is called.)Ú firstiterÚ finalizerFN)rÉrÚ_set_coroutine_origin_trackingÚ_debugrÚ get_identr²ÚsysÚget_asyncgen_hooksÚset_asyncgen_hooksrúrórZ_set_running_loopÚ _run_oncer­)rkZold_agen_hooksrrrÚ run_foreverLs.  ÿ    ü  zBaseEventLoop.run_foreverc Csª| ¡| ¡t |¡ }tj||d�}|r4d|_| t¡zFz |  ¡Wn*|rp|  ¡rp|  ¡sp|  ¡‚Yn0W|  t¡n |  t¡0|  ¡s¢tdƒ‚| ¡S)a\Run until the Future is done. If the argument is a coroutine, it is wrapped in a Task. WARNING: It would be disastrous to call run_until_complete() with the same coroutine twice -- it would wrap it in two different Tasks and that can't be good. Return the Future's result, or raise its exception. rÅFz+Event loop stopped before Future completed.)rÉrrZisfuturer Z ensure_futureZ_log_destroy_pendingÚadd_done_callbackr[rršrTrUZremove_done_callbackrrr)rkr Znew_taskrrrÚrun_until_completecs"     z BaseEventLoop.run_until_completecCs d|_dS)z´Stop running the event loop. Every callback already scheduled will still run. This simply informs run_forever to stop looping after a complete iteration. TN)r­rwrrrrX‰szBaseEventLoop.stopcCsp| ¡rtdƒ‚|jrdS|jr,t d|¡d|_|j ¡|j ¡d|_ |j }|durld|_ |j dd�dS)z¾Close the event loop. This clears the queues and shuts down the executor, but does not wait for the executor to finish. The event loop must not be running. z!Cannot close a running event loopNzClose %rTFr) rÂrrr¬rrÚdebugr¯rþr°rÁr±r©rkÚexecutorrrrr£‘s   zBaseEventLoop.closecCs|jS)z*Returns True if the event loop was closed.)r¬rwrrrrèszBaseEventLoop.is_closedcCs0| ¡s,|d|›�t|d�| ¡s,| ¡dS)Nzunclosed event loop rô)rÃrørÂr£)rkÚ_warnrrrÚ__del__¬szBaseEventLoop.__del__cCs |jduS)z*Returns True if the event loop is running.N)r²rwrrrr²szBaseEventLoop.is_runningcCst ¡S)zçReturn the time according to the event loop's clock. This is a float expressed in seconds since an epoch, but the epoch, precision, accuracy and drift are unspecified and may differ per event loop. )r³rªrwrrrr³¶szBaseEventLoop.time)ÚcontextcGs4|j| ¡||g|¢Rd|iŽ}|jr0|jd=|S)a8Arrange for a callback to be called at a given time. Return a Handle: an opaque object with a cancel() method that can be used to cancel the call. The delay can be an int or float, expressed in seconds. It is always relative to the current time. Each callback will be called exactly once. If two callbacks are scheduled for exactly the same time, it undefined which will be called first. Any positional arguments after the callback will be passed to the callback when it is called. r%rÈ)Úcall_atr³rÊ)rkÚdelayÚcallbackr%râÚtimerrrrÚ call_later¿s ÿzBaseEventLoop.call_latercGsZ| ¡|jr"| ¡| |d¡t |||||¡}|jrB|jd=t |j |¡d|_ |S)z|Like call_later(), but uses an absolute time. Absolute time corresponds to the event loop's time() method. r&rÈT) rÉrÚ _check_threadÚ_check_callbackrÚ TimerHandlerÊÚheapqÚheappushr°)rkÚwhenr(r%râr)rrrr&Õs zBaseEventLoop.call_atcGsB| ¡|jr"| ¡| |d¡| |||¡}|jr>|jd=|S)aTArrange for a callback to be called as soon as possible. This operates as a FIFO queue: callbacks are called in the order in which they are registered. Each callback will be called exactly once. Any positional arguments after the callback will be passed to the callback when it is called. Ú call_soonrÈ)rÉrr+r,Ú _call_soonrÊ©rkr(r%rârrrrr1ås  zBaseEventLoop.call_sooncCsDt |¡st |¡r$td|›d�ƒ‚t|ƒs@td|›d|›�ƒ‚dS)Nzcoroutines cannot be used with z()z"a callable object was expected by z(), got )rZ iscoroutineZiscoroutinefunctionr8rÍ)rkr(Úmethodrrrr,øs ÿ ÿÿÿzBaseEventLoop._check_callbackcCs.t ||||¡}|jr|jd=|j |¡|S)NrÈ)rÚHandlerÊr¯r<)rkr(râr%rrrrr2s  zBaseEventLoop._call_sooncCs,|jdurdSt ¡}||jkr(tdƒ‚dS)aoCheck that the current thread is the thread running the event loop. Non-thread-safe methods of this class make this assumption and will likely behave incorrectly when the assumption is violated. Should only be called when (self._debug == True). The caller is responsible for checking this condition for performance reasons. NzMNon-thread-safe operation invoked on an event loop other than the current one)r²rrrr)rkZ thread_idrrrr+ s  ÿzBaseEventLoop._check_threadcGsB| ¡|jr| |d¡| |||¡}|jr6|jd=| ¡|S)z"Like call_soon(), but thread-safe.rïrÈ)rÉrr,r2rÊrêr3rrrrïs z"BaseEventLoop.call_soon_threadsafecGsh| ¡|jr| |d¡|durL|j}| ¡|durLtjjdd�}||_tj|j |g|¢RŽ|d�S)NÚrun_in_executorZasyncio)Zthread_name_prefixrÅ) rÉrr,r±ríÚ concurrentrÚThreadPoolExecutorZ wrap_futureÚsubmit)rkr"Úfuncrârrrr6%s ÿÿzBaseEventLoop.run_in_executorcCs&t|tjjƒst dtd¡||_dS)Nz{Using the default executor that is not an instance of ThreadPoolExecutor is deprecated and will be prohibited in Python 3.9é)rr7rr8rör÷ÚDeprecationWarningr±r!rrrÚset_default_executor5s üz"BaseEventLoop.set_default_executorc CsÞ|›d|›�g}|r$| d|›�¡|r8| d|›�¡|rL| d|›�¡|r`| d|›�¡d |¡}t d|¡| ¡}t ||||||¡} | ¡|} d|›d | d d ›d | ›�}| |jkrÐt |¡n t |¡| S) Nú:zfamily=ztype=zproto=zflags=ú, zGet address info %szGetting address info z took g@�@z.3fzms: ) r<r rr r³r&Ú getaddrinfor¸Úinfo) rkr>r?r@rArBÚflagsÚmsgÚt0ÚaddrinfoÚdtrrrÚ_getaddrinfo_debug>s&      z BaseEventLoop._getaddrinfo_debugr©r@rArBrBc Ãs2|jr|j}ntj}| d|||||||¡IdHSrE)rrGr&r@r6)rkr>r?r@rArBrBZ getaddr_funcrrrr@Vs ÿzBaseEventLoop.getaddrinfocÃs| dtj||¡IdHSrE)r6r&Ú getnameinfo)rkZsockaddrrBrrrrI`s ÿzBaseEventLoop.getnameinfo)Úfallbackc ÃsŽ|jr| ¡dkrtdƒ‚t|ƒ| ||||¡z| ||||¡IdHWStjyv}z|sb‚WYd}~n d}~00| ||||¡IdHS)Nrzthe socket must be non-blocking) rÚ gettimeoutr'r`Ú_check_sendfile_paramsÚ_sock_sendfile_nativerÚSendfileNotAvailableErrorÚ_sock_sendfile_fallback)rkr,ÚfileÚoffsetÚcountrJrZrrrÚ sock_sendfiledsÿ ÿzBaseEventLoop.sock_sendfilecÃst d|›d|›d�¡‚dS)Nz-syscall sendfile is not available for socket z and file z combination©rrN©rkr,rPrQrRrrrrMss ÿÿz#BaseEventLoop._sock_sendfile_nativec Ãsð|r| |¡|rt|tjƒntj}t|ƒ}d}z”|rNt|||ƒ}|dkrNqžt|ƒd|…}| d|j|¡IdH} | szqž| ||d| …¡IdH|| 7}q2|W|dkrÂt |dƒrÂ| ||¡Sn&|dk�rêt |dƒ�rê| ||¡0dS)NrÚseek) rVÚminrZ!SENDFILE_FALLBACK_READBUFFER_SIZEÚ bytearrayÚ memoryviewr6ÚreadintoZ sock_sendallr%) rkr,rPrQrRÚ blocksizeÚbufÚ total_sentÚviewÚreadrrrrOzs6 ÿþ ýÿz%BaseEventLoop._sock_sendfile_fallbackcCs”dt|ddƒvrtdƒ‚|jtjks,tdƒ‚|durbt|tƒsLtd |¡ƒ‚|dkrbtd |¡ƒ‚t|tƒsztd |¡ƒ‚|dkr�td |¡ƒ‚dS)NÚbÚmodez$file should be opened in binary modez+only SOCK_STREAM type sockets are supportedz+count must be a positive integer (got {!r})rz0offset must be a non-negative integer (got {!r})) rr'rAr&r4rr7r8ÚformatrUrrrrL”s2  ÿÿ ÿÿÿÿz$BaseEventLoop._check_sendfile_paramsc ÃsDg}| |¡|\}}}}} d} z¼tj|||d�} |  d¡|durÆ|D]t\}}}}} z|  | ¡WqÆWqHtyº} z8d| ›d| j ¡›�} t| j| ƒ} | | ¡WYd} ~ qHd} ~ 00qH| ¡‚|  | | ¡IdH| WSt�y } z*| | ¡| du�r |   ¡‚WYd} ~ n(d} ~ 0| du�r8|   ¡‚Yn0dS)z$Create, bind and connect one socket.N©r@rArBFz*error while attempting to bind on address ú: ) r<r&Ú setblockingÚbindr*ÚstrerrorÚlowerÚerrnoÚpopÚ sock_connectr£)rkrZ addr_infoZlocal_addr_infosZ my_exceptionsr@Útype_rBÚ_rÜr,ÚladdrrZrCrrrÚ _connect_sock©sB    ÿþÿ "   zBaseEventLoop._connect_sock) r_r@rBrBr,Ú local_addrrØr’Úhappy_eyeballs_delayÚ interleavec  ƒsz| dur|stdƒ‚| dur0|r0|s,tdƒ‚|} | durD|sDtdƒ‚|durTt|ƒ| durh| durhd} |dusz|du�r|durŠtdƒ‚ˆj||f|tj||ˆd�IdH}|s¸tdƒ‚| durìˆj| |tj||ˆd�IdH‰ˆsðtdƒ‚nd‰| rþt|| ƒ}g‰| du�rV|D]B}z ˆ ˆ|ˆ¡IdH}W�q„Wnt�yNY�qYn0�qn.tj ‡‡‡fd d „|Dƒ| ˆd �IdH\}}}|du�r.d d „ˆDƒ‰t ˆƒdk�r´ˆd‚nJt ˆdƒ‰t ‡fdd „ˆDƒƒ�ràˆd‚td  d dd „ˆDƒ¡¡ƒ‚n.|du�rtdƒ‚|jtjk�r.td|›�ƒ‚ˆj|||| | d�IdH\}}ˆj�rr| d¡}t d|||||¡||fS)aöConnect to a TCP server. Create a streaming transport connection to a given Internet host and port: socket family AF_INET or socket.AF_INET6 depending on host (or family if specified), socket type SOCK_STREAM. protocol_factory must be a callable returning a protocol instance. This method is a coroutine which will try to establish the connection in the background. When successful, the coroutine returns a (transport, protocol) pair. Nz+server_hostname is only meaningful with sslz:You must set server_hostname when using ssl without a hostú1ssl_handshake_timeout is only meaningful with sslrú8host/port and sock can not be specified at the same time©r@rArBrBrŽú!getaddrinfo() returned empty listc3s |]}t ˆjˆ|ˆ¡VqdSrE)Ú functoolsÚpartialro)rFrE)rÚ laddr_infosrkrrrH!sþÿz2BaseEventLoop.create_connection..rÅcSsg|]}|D]}|‘q qSrr)rFÚsubrZrrrrû'r/z3BaseEventLoop.create_connection..rc3s|]}t|ƒˆkVqdSrE©r©rFrZ)ÚmodelrrrH-r/zMultiple exceptions: {}r?css|]}t|ƒVqdSrEr{r|rrrrH2r/z5host and port was not specified and no sock specifiedú"A Stream Socket was expected, got )r’r&z%r connected to %s:%r: (%r, %r))r'r`Ú_ensure_resolvedr&r4r*rSror Zstaggered_racerýrÚallrbr rAÚ_create_connection_transportrÚget_extra_inforr )rkr�r>r?r_r@rBrBr,rprØr’rqrrÚinfosrErmrsrÕr)rryr}rkrÚcreate_connectionÍs    ÿÿ þ ý    ÿ  þü   ÿ ÿÿþ  ÿzBaseEventLoop.create_connectionc Ãs„| d¡|ƒ}| ¡}|rHt|tƒr*dn|} |j||| ||||d�} n| |||¡} z|IdHWn|  ¡‚Yn0| |fS)NF©r×rØr’)rerirÚboolrÛrÖr£) rkr,r�r_rØr×r’rÕrœrÚrsrrrr�Ms" ýz*BaseEventLoop._create_connection_transportc Ãs´| ¡rtdƒ‚t|dtjjƒ}|tjjur:td|›�ƒ‚|tjjurŒz| ||||¡IdHWStj yŠ}z|sv‚WYd}~n d}~00|sžtd|›�ƒ‚|  ||||¡IdHS)a„Send a file to transport. Return the total number of bytes which were sent. The method uses high-performance os.sendfile if available. file must be a regular file object opened in binary mode. offset tells from where to start reading the file. If specified, count is the total number of bytes to transmit as opposed to sending the file until EOF is reached. File position is updated on return or also in case of error in which case file.tell() can be used to figure out the number of bytes which were sent. fallback set to True makes asyncio to manually read and send the file when the platform does not support the sendfile syscall (e.g. Windows or SSL socket on Unix). Raise SendfileNotAvailableError if the system does not support sendfile syscall and fallback is False. zTransport is closingZ_sendfile_compatiblez(sendfile is not supported for transport NzHfallback is disabled and native sendfile is not supported for transport ) rnrrrrZ _SendfileModeZ UNSUPPORTEDZ TRY_NATIVEÚ_sendfile_nativerrNÚ_sendfile_fallback)rkrsrPrQrRrJrarZrrrÚsendfilegs4ÿ ÿ ÿ ÿÿÿzBaseEventLoop.sendfilecÃst d¡‚dS)Nz!sendfile syscall is not supportedrT)rkrlrPrQrRrrrr‡–sÿzBaseEventLoop._sendfile_nativec Ãs||r| |¡|rt|dƒnd}t|ƒ}d}t|ƒ}�z |r†t|||ƒ}|dkr†|W|dkrvt|dƒrv| ||¡| ¡IdHSt|ƒd|…} | d|j| ¡IdH} | sä|W|dkrÔt|dƒrÔ| ||¡| ¡IdHS|  ¡IdH|  | d| …¡|| 7}q8W|dk�r4t|dƒ�r4| ||¡| ¡IdHn4|dk�rht|dƒ�rh| ||¡| ¡IdH0dS)Ni@rrV) rVrWrXrar%r�rYr6rZrpÚwrite) rkrlrPrQrRr[r\r]rBr^r_rrrrˆšs@  õù þz BaseEventLoop._sendfile_fallbackr…c ÃsÖtdurtdƒ‚t|tjƒs*td|›�ƒ‚t|ddƒsFtd|›d�ƒ‚| ¡}tj|||||||dd�}|  ¡|  |¡|  |j |¡} |  |j ¡} z|IdHWn,tyÎ| ¡|  ¡|  ¡‚Yn0|jS) zzUpgrade transport to TLS. Return a new transport that *protocol* should start using immediately. Nz"Python ssl module is not availablez@sslcontext is expected to be an instance of ssl.SSLContext, got Z_start_tls_compatibleFz transport z is not supported by start_tls())r’rÙ)r_rrrZ SSLContextr8rrir Z SSLProtocolrfrgr1rtrÚ BaseExceptionr£r€Z_app_transport) rkrsrÕrÚr×rØr’rœZ ssl_protocolZ conmade_cbZ resume_cbrrrÚ start_tls³s>  ÿÿ  ÿü   zBaseEventLoop.start_tls)r@rBrBÚ reuse_addressÚ reuse_portÚallow_broadcastr,c ƒs| dur�| jtjkr"td| ›�ƒ‚ˆs>ˆs>|s>|s>|s>|s>| r~tˆˆ|||||| d�} d dd„|  ¡Dƒ¡} td| ›d�ƒ‚|  d ¡d} �nˆsºˆsº|d kr¨td ƒ‚||fd ff}�n°ttd ƒ�rŒ|tj k�rŒˆˆfD]}|durÚt |t ƒsÚt dƒ‚qÚˆ�rxˆd dv�rxz"t  t  ˆ¡j¡�r.t ˆ¡WnFt�yDYn4t�yv}zt dˆ|¡WYd}~n d}~00||fˆˆfff}nÞi}d ˆfdˆffD]¢\}}|du�r t |tƒ�rÌt|ƒdk�sÔt dƒ‚|j||tj|||d�IdH}|�stdƒ‚|D]:\}}}}}||f}||v�r0ddg||<||||<�q�q ‡‡fdd„| ¡Dƒ}|�sjtdƒ‚g}|tu�r˜|�rˆtdƒ‚ntjdtdd�|D]ú\\}}\}}d} d} zxtj|tj|d�} |�rÖt| ƒ| �rî|  tjtj d¡|  d ¡ˆ�r|  !|¡ˆ�r*| �s&| "| |¡IdH|} Wn`t�yn}z(| du�rP|  #¡| $|¡WYd}~n.d}~0| du�r†|  #¡‚Yn0�q �qœ|d ‚|ƒ}| %¡}| &| || |¡}|j'�rðˆ�ràt (dˆˆ||¡nt )dˆ||¡z|IdHWn| #¡‚Yn0||fS)zCreate datagram connection.NzA UDP Socket was expected, got )rpÚ remote_addrr@rBrBr�rŽr�r?css$|]\}}|r|›d|›�VqdS)ú=Nr)rFÚkÚvrrrrHór/z9BaseEventLoop.create_datagram_endpoint..zKsocket modifier keyword arguments can not be used when sock is specified. (ú)Frzunexpected address family)NNÚAF_UNIXzstring is expected)rúz2Unable to check or remove stale UNIX socket %r: %rrr;z2-tuple is expectedrurvcs8g|]0\}}ˆr|ddusˆr,|ddus||f‘qS)rNrr)rFÚkeyZ addr_pair©rpr�rrrû&sþz:BaseEventLoop.create_datagram_endpoint..zcan not get address informationz~Passing `reuse_address=True` is no longer supported, as the usage of SO_REUSEPORT in UDP poses a significant security concern.zdThe *reuse_address* parameter has been deprecated as of 3.5.10 and is scheduled for removal in 3.11.)Ú stacklevelrcz@Datagram endpoint local_addr=%r remote_addr=%r created: (%r, %r)z2Datagram endpoint remote_addr=%r created: (%r, %r))*rAr&r5r'Údictr Úitemsrer%r•rrr8ÚstatÚS_ISSOCKÚosÚst_modeÚremoveÚFileNotFoundErrorr*rÚerrorr¢rýrÚ_unsetrör÷r<r-r(r)Ú SO_BROADCASTrfrkr£r<rirÝrrAr ) rkr�rpr�r@rBrBr�rŽr�r,ZoptsZproblemsZr_addrZaddr_pairs_inforRÚerrZ addr_infosÚidxrƒZfamrmZprorÜr—rZ local_addressZremote_addressrZrÕrœrsrr˜rÚcreate_datagram_endpointás ÿÿÿÿþþýÿÿ   þÿ þ    ÿ  ýÿ ÿ ÿ     ÿþþz&BaseEventLoop.create_datagram_endpointc Ãs^|dd…\}}t|||||g|dd…¢RŽ} | dur>| gS|j||||||d�IdHSdS)Nr;rH)rDr@) rkrÜr@rArBrBrŽr>r?rArrrrts  ÿzBaseEventLoop._ensure_resolvedcÃs8|j||f|tj||d�IdH}|s4td|›d�ƒ‚|S)N)r@rArBrŽz getaddrinfo(z) returned empty list)rr&r4r*)rkr>r?r@rBrƒrrrÚ_create_server_getaddrinfo€s þ z(BaseEventLoop._create_server_getaddrinfor) r@rBr,r‘r_r�rŽr’r¥c  ƒsÞt|tƒrtdƒ‚| dur*|dur*tdƒ‚|dur:t|ƒ|dusLˆdu�rL|dur\tdƒ‚| durxtjdkovtjdk} g} |dkrŒdg}n$t|t ƒs¤t|t j j ƒs¬|g}n|}‡‡‡‡fdd „|Dƒ}t j|d ˆiŽIdH}ttj |¡ƒ}d }�z8|D�]}|\}}}}}zt |||¡}Wn6tj�yVˆj�rNtjd |||d d�YqúYn0|  |¡| �rz| tjtjd ¡| �rˆt|ƒt�r¸|tjk�r¸ttdƒ�r¸| tj tj!d ¡z| "|¡Wqút#�y}z(t#|j$d||j% &¡fƒd‚WYd}~qúd}~00qúd }W|�sJ| D]}| '¡�qn|�sH| D]}| '¡�q80n4|du�r^tdƒ‚|j(tj)k�rztd|›�ƒ‚|g} | D]}| *d ¡�q„t+ˆ| |||| ƒ}| �rÆ| ,¡t  -d¡IdHˆj�rÚt .d|¡|S)a1Create a TCP server. The host parameter can be a string, in that case the TCP server is bound to host and port. The host parameter can also be a sequence of strings and in that case the TCP server is bound to all hosts of the sequence. If a host appears multiple times (possibly indirectly e.g. when hostnames resolve to the same IP address), the server is only bound once to that host. Return a Server object which can be used to stop the service. This method is a coroutine. z*ssl argument must be an SSLContext or NoneNrsrtÚposixÚcygwinr0csg|]}ˆj|ˆˆˆd�‘qS))r@rB)r¨)rFr>©r@rBr?rkrrrû½sþ ÿz/BaseEventLoop.create_server..rŽFz:create_server() failed to create socket.socket(%r, %r, %r)T©Úexc_infoÚ IPPROTO_IPV6z0error while attempting to bind on address %r: %sz)Neither host/port nor sock were specifiedr~rz %r is serving)/rr†r8r'r`ržrÇrÚplatformrrIÚabcÚIterabler rÿÚsetrNrOrPr&r¢rrÚwarningr<r(r)Ú SO_REUSEADDRr-r;rr%r®Ú IPV6_V6ONLYrfr*rirgrhr£rAr4rerržr¤rA)rkr�r>r?r@rBr,r‘r_r�rŽr’r¥r�ÚhostsÚfsrƒZ completedÚresrCÚsocktyperBÚ canonnameÚsar¥rÒrr«rÚ create_serverˆs® ÿÿ  ÿþ þ   ÿÿþþ þþþ ÿ zBaseEventLoop.create_server)r_r’cÃs†|jtjkrtd|›�ƒ‚|dur.|s.tdƒ‚|dur>t|ƒ|j|||dd|d�IdH\}}|jr~| d¡}t  d|||¡||fS) aHandle an accepted connection. This is used by servers that accept connections outside of asyncio but that use asyncio to handle connections. This method is a coroutine. When completed, the coroutine returns a (transport, protocol) pair. r~Nrsr0T)r×r’r&z%r handled: (%r, %r)) rAr&r4r'r`r�rr‚rr )rkr�r,r_r’rsrÕrrrÚconnect_accepted_sockets  ÿ þ z%BaseEventLoop.connect_accepted_socketcÃsd|ƒ}| ¡}| |||¡}z|IdHWn| ¡‚Yn0|jr\t d| ¡||¡||fS)Nz Read pipe %r connected: (%r, %r))riràr£rrr Úfileno©rkr�rßrÕrœrsrrrÚconnect_read_pipe s ÿzBaseEventLoop.connect_read_pipecÃsd|ƒ}| ¡}| |||¡}z|IdHWn| ¡‚Yn0|jr\t d| ¡||¡||fS)Nz!Write pipe %r connected: (%r, %r))rirár£rrr r¾r¿rrrÚconnect_write_pipe0s ÿz BaseEventLoop.connect_write_pipecCs–|g}|dur"| dt|ƒ›�¡|durJ|tjkrJ| dt|ƒ›�¡n8|durf| dt|ƒ›�¡|dur‚| dt|ƒ›�¡t d |¡¡dS)Nzstdin=zstdout=stderr=zstdout=zstderr=ú )r<r#rr!rr r )rkrCrärårærArrrÚ_log_subprocess@szBaseEventLoop._log_subprocess) räråræÚuniversal_newlinesrãrçÚencodingÚerrorsÚtextc ËsÚt|ttfƒstdƒ‚|r"tdƒ‚|s.tdƒ‚|dkr>tdƒ‚| rJtdƒ‚| durZtdƒ‚| durjtdƒ‚|ƒ} d}|jr’d |}| ||||¡|j| |d ||||fi| ¤ŽIdH}|jrÒ|durÒt d ||¡|| fS) Nzcmd must be a stringú universal_newlines must be Falsezshell must be Truerúbufsize must be 0útext must be Falseúencoding must be Noneúerrors must be Nonezrun shell command %rTú%s: %r) rr6rr'rrÃrérrA)rkr�ÚcmdrärårærÄrãrçrÅrÆrÇrèrÕÚ debug_logrsrrrÚsubprocess_shellMs6ÿÿ zBaseEventLoop.subprocess_shellc ÏsÐ|r tdƒ‚|rtdƒ‚|dkr(tdƒ‚| r4tdƒ‚| durDtdƒ‚| durTtdƒ‚|f| }|ƒ}d}|jrˆd|›�}| ||||¡|j||d ||||fi| ¤ŽIdH}|jrÈ|durÈt d ||¡||fS) NrÈzshell must be FalserrÉrÊrËrÌzexecute program FrÍ)r'rrÃrérrA)rkr�ZprogramrärårærÄrãrçrÅrÆrÇrârèZ popen_argsrÕrÏrsrrrÚsubprocess_execqs6   þþ zBaseEventLoop.subprocess_execcCs|jS)zKReturn an exception handler, or None if the default one is in use. )r¶rwrrrÚget_exception_handler“sz#BaseEventLoop.get_exception_handlercCs(|durt|ƒstd|›�ƒ‚||_dS)a³Set handler as the new event loop exception handler. If handler is None, the default exception handler will be set. If handler is a callable object, it should have a signature matching '(loop, context)', where 'loop' will be a reference to the active event loop, 'context' will be a dict object (see `call_exception_handler()` documentation for details about context). Nz+A callable object or None is expected, got )rÍr8r¶)rkÚhandlerrrrÚset_exception_handler˜s ÿz#BaseEventLoop.set_exception_handlerc Cs| d¡}|sd}| d¡}|dur6t|ƒ||jf}nd}d|vr`|jdur`|jjr`|jj|d<|g}t|ƒD]†}|dvr|qn||}|dkr®d  t |¡¡}d }||  ¡7}n2|dkrØd  t |¡¡}d }||  ¡7}nt |ƒ}|  |›d |›�¡qnt j d  |¡|d�dS)aEDefault exception handler. This is called when an exception occurs and no exception handler is set, and can be called by a custom exception handler that wants to defer to the default behavior. This default handler logs the error message and other context-dependent information. In debug mode, a truncated stack trace is also appended showing where the given object (e.g. a handle or future or task) was created, if any. The context parameter has the same meaning as in `call_exception_handler()`. rüz!Unhandled exception in event looprUNFZsource_tracebackZhandle_traceback>rürUr0z+Object created at (most recent call last): z+Handle created at (most recent call last): rdÚ r¬)ÚgetrAÚ __traceback__r¹rÊÚsortedr Ú tracebackÚ format_listÚrstriprr<rr¢) rkr%rürUr­Z log_linesr—ÚvalueÚtbrrrÚdefault_exception_handler©s<  ÿþÿ z'BaseEventLoop.default_exception_handlerc Csð|jdurRz| |¡Wqìttfy0‚YqìtyNtjddd�Yqì0nšz| ||¡Wnˆttfyz‚Ynrtyê}zZz| d||dœ¡Wn6ttfy¶‚Yn tyÔtjddd�Yn0WYd}~n d}~00dS)aDCall the current event loop's exception handler. The context argument is a dict containing the following keys: - 'message': Error message; - 'exception' (optional): Exception object; - 'future' (optional): Future instance; - 'task' (optional): Task instance; - 'handle' (optional): Handle instance; - 'protocol' (optional): Protocol instance; - 'transport' (optional): Transport instance; - 'socket' (optional): Socket instance; - 'asyncgen' (optional): Asynchronous generator that caused the exception. New keys maybe introduced in the future. Note: do not overload this method in an event loop subclass. For custom exception handling, use the `set_exception_handler()` method. Nz&Exception in default exception handlerTr¬z$Unhandled error in exception handler)rürUr%zeException in default exception handler while handling an unexpected error in custom exception handler)r¶rÞrVrWr‹rr¢)rkr%rZrrrrÛs4  ÿý  ýz$BaseEventLoop.call_exception_handlercCs>t|tjƒsJdƒ‚|jrdSt|tjƒr.J‚|j |¡dS)z3Add a Handle to _scheduled (TimerHandle) or _ready.zA Handle is required hereN)rrr5Ú _cancelledr-r¯r<©rkrrrrÚ _add_callbacks zBaseEventLoop._add_callbackcCs| |¡| ¡dS)z6Like _add_callback() but called from a signal handler.N)rárêràrrrÚ_add_callback_signalsafes z&BaseEventLoop._add_callback_signalsafecCs|jr|jd7_dS)z3Notification that a TimerHandle has been cancelled.rN)r°r«ràrrrÚ_timer_handle_cancelled!sz%BaseEventLoop._timer_handle_cancelledc CsØt|jƒ}|tkr`|j|tkr`g}|jD]}|jrsf                   ;   Do