Ϫf4dZddlZddlmZddlmZGddeZGddeZGd d eZ Gd d eZ Gd de Z GddeZ GddeZGddeZGddeZGddeZGddeZGddeZGddeZGdd eZGd!d"eZGd#d$eZGd%d&eZGd'd(eZGd)d*eZGd+d,eZ ddlZej:eej<eej>eiZ e!ed-ree ejD<ee ejF<d.Z%Gd/d0eZ&Gd1d2e&Z'Gd3d4e'Z(Gd5d6e&Z)Gd7d8e'Z*Gd9d:e'Z+Gd;de,Z.Gd?d@e/Z0ejbedAdBdddCe2d@GdDdEe)Z3GdFdGe'Z4GdHdIeZ5GdJdKe6Z7GdLdMe6Z8GdNdOe6Z9GdPdQe6Z:GdRdSe6Z;GdTdUe<Z=GdVdWeZ>GdXdYeZ?GdZd[eZ@Gd\d]eZAGd^d_eZBGd`dae,ZCgdbZDy#e$$riZ Y8wxYw)cz< Exceptions and errors for use in twisted.internet modules. N)Version) deprecatec eZdZdxZZdefdZy) BindErrorz)An error occurred binding to an interfacereturnc|j}|jr+dj|dj|j}d|z}|SNz{}: {} %s.MESSAGEargsformatjoinselfss 8/usr/lib/python3/dist-packages/twisted/internet/error.py__str__zBindError.__str__= LL 99388DII#67A AIN__name__ __module__ __qualname____doc__r strrrrrrsCCGgrrc"eZdZdZdZdefdZy)CannotListenErrora2 This gets raised by a call to startListening, when the object cannotstart listening. @ivar interface: the interface I tried to listen on @ivar port: the port I tried to listen on @ivar socketError: the exception I got when I tried to listen @type socketError: L{socket.error} c^tj||||||_||_||_yN)r__init__ interfaceport socketError)rr$r%r&s rr#zCannotListenError.__init__&s,4D+>" &rrcp|jxsd}dj||j|jS)NanyzCouldn't listen on {}:{}: {}.)r$rr%r&)rifaces rrzCannotListenError.__str__,s4'%.55 499d..  rN)rrrrr#rrrrrr r s'   rr ceZdZdZy)MulticastJoinErrorz6 An attempt to join a multicast group failed. Nrrrrrrrr+r+3rr+c eZdZdxZZdefdZy)MessageLengthErrorzMessage is too long to sendrc|j}|jr+dj|dj|j}d|z}|Sr r rs rrzMessageLengthError.__str__<rrNrrrrr/r/9s55Ggrr/c eZdZdxZZdefdZy)DNSLookupErrorzDNS lookup failedrc|j}|jr+dj|dj|j}d|z}|Sr r rs rrzDNSLookupError.__str__GrrNrrrrr2r2Ds++Ggrr2ceZdZdZy)ConnectInProgressErrorz3A connect operation was started and isn't done yet.Nr,rrrr5r5Os=rr5c(eZdZdxZZddZdefdZy) ConnectErrorz"An error occurred while connectingNc>||_tj||yr")osError Exceptionr#)rr9strings rr#zConnectError.__init__Ys 4(rrc|j}|jr|d|j}|jdr|d|jd}d|z}|S)N: rr )r r9rrs rrzConnectError.__str__]sW LL <<#R ~&A 99Q<#R ! ~&A AIr)N)rrrrr r#rrrrrr7r7Vs<>GgrrGceZdZdxZZy)TCPTimedOutErrorzTCP connection timed outNrArrrrJrJws 22GgrrJceZdZdxZZy) BadFileErrorz$File used for UNIX socket is no goodNrArrrrLrL{rHrrLceZdZdxZZy)ServiceNameUnknownErrorz%Service name given as port is unknownNrArrrrNrNs ??GgrrNceZdZdxZZy) UserErrorzUser aborted connectionNrArrrrPrPs 11GgrrPceZdZdxZZy) TimeoutErrorz&User timeout caused connection failureNrArrrrRrRs @@GgrrRceZdZdxZZy)SSLErrorzAn SSL error occurredNrArrrrTrTs //GgrrTceZdZdxZZy) VerifyErrorz:Could not verify something that was supposed to be signed.NrArrrrVrVs TTGgrrVceZdZdxZZy)PeerVerifyErrorz#The peer rejected our verify error.NrArrrrXrXs ==GgrrXceZdZdxZZy)CertificateErrorz)r strip splitlinesrappendrrs rrzConnectionLost.__str__sh LL   + + -bq 1 99 HHTN HHSXXdii( )  wwqzrNrrrrrkrksGgrrkceZdZdZdZy)ConnectionAbortedz Connection was aborted locally, using L{twisted.internet.interfaces.ITCPTransport.abortConnection}. @since: 11.1 zBConnection was aborted locally using ITCPTransport.abortConnectionNrArrrrsrssVGrrsc eZdZdxZZdefdZy)ConnectionDonezConnection was closed cleanlyrc|j}|jr+dj|dj|j}d|z}|Sr r rs rrzConnectionDone.__str__rrNrrrrrurus77GgrruceZdZdZdZy)FileDescriptorOverrunaw A mis-use of L{IUNIXTransport.sendFileDescriptor} caused the connection to be closed. Each file descriptor sent using C{sendFileDescriptor} must be associated with at least one byte sent using L{ITransport.write}. If at any point fewer bytes have been written than file descriptors have been sent, the connection is closed with this exception. zRA mis-use of IUNIXTransport.sendFileDescriptor caused the connection to be closed.NrArrrrxrxs ' rrxceZdZdxZZy)ConnectionFdescWentAwayUhNrArrrrzrzs Ggrrzc eZdZdxZZdefdZy) AlreadyCalledz'Tried to cancel an already-called eventrc|j}|jr+dj|dj|j}d|z}|Sr r rs rrzAlreadyCalled.__str__rrNrrrrr}r}sAAGgrr}c eZdZdxZZdefdZy)AlreadyCancelledz*Tried to cancel an already-cancelled eventrc|j}|jr+dj|dj|j}d|z}|Sr r rs rrzAlreadyCancelled.__str__ rrNrrrrrrsDDGgrrceZdZdZdZy)PotentialZombieWarningz Emitted when L{IReactorProcess.spawnProcess} is called in a way which may result in termination of the created child process not being reported. Deprecated in Twisted 10.0. zspawnProcess called, but the SIGCHLD handler is not installed. This probably means you have not yet called reactor.run, or called reactor.run(installSignalHandler=0). You will probably never see this process finish, and it may become a zombie process.NrArrrrrs  rrTwisted z4There is no longer any potential for zombie process.ceZdZdxZZdZy) ProcessDonez+A process has ended without apparent errorscZtj|dd|_d|_||_y)Nz!process finished with exit code 0r)r:r#exitCodesignalstatus)rrs rr#zProcessDone.__init__0s(4!DE   rNrrrrr r#rrrrr-sEEGgrrceZdZdxZZddZy)ProcessTerminatedz A process has ended with a probable error condition @ivar exitCode: See L{__init__} @ivar signal: See L{__init__} @ivar status: See L{__init__} Nc||_||_||_d}||d|zz}||d|zz}tj ||y)a @param exitCode: The exit status of the process. This is roughly like the value you might pass to L{os._exit}. This is L{None} if the process exited due to a signal. @type exitCode: L{int} or L{None} @param signal: The exit signal of the process. This is L{None} if the process did not exit due to a signal. @type signal: L{int} or L{None} @param status: The exit code of the process. This is a platform specific combination of the exit code and the exit signal. See L{os.WIFEXITED} and related functions. @type status: L{int} z process endedNz with exit code %sz by signal %s)rrrr:r#)rrrrrs rr#zProcessTerminated.__init__@sY !     (833A  Of,,A4#r)NNNrrrrrr7sGg$rrceZdZdZy)ProcessExitedAlreadyzd The process has already exited and the operation requested can no longer be performed. Nr,rrrrr[rrc eZdZdxZZdefdZy)NotConnectingErrorzEThe Connector was not connecting when it was asked to stop connectingrc|j}|jr+dj|dj|j}d|z}|Sr r rs rrzNotConnectingError.__str__grrNrrrrrrbs PPGrrc eZdZdxZZdefdZy)NotListeningErrorz>The Port was not listening when it was asked to stop listeningrc|j}|jr+dj|dj|j}d|z}|Sr r rs rrzNotListeningError.__str__rrrNrrrrrrosXXGgrrceZdZdZy)ReactorNotRunningzJ Error raised when trying to stop a reactor which is not running. Nr,rrrrrzr-rrceZdZdZy)ReactorNotRestartablezF Error raised when trying to run a reactor which was stopped. Nr,rrrrrr-rrceZdZdZy)ReactorAlreadyRunningzG Error raised when trying to start the reactor multiple times. Nr,rrrrrr-rrceZdZdZy)ReactorAlreadyInstalledErrorzE Could not install reactor because one is already installed. Nr,rrrrrr-rrceZdZdZdZy)ConnectingCancelledErrorz An C{Exception} that will be raised when an L{IStreamClientEndpoint} is cancelled before it connects. @ivar address: The L{IAddress} that is the destination of the cancelled L{IStreamClientEndpoint}. c>tj||||_y)z @param address: The L{IAddress} that is the destination of the L{IStreamClientEndpoint} that was cancelled. N)r:r#address)rrs rr#z!ConnectingCancelledError.__init__s 4) rNrrrrr#rrrrrs rrceZdZdZy) NoProtocolz An C{Exception} that will be raised when the factory given to a L{IStreamClientEndpoint} returns L{None} from C{buildProtocol}. Nr,rrrrrrrrceZdZdZy)UnsupportedAddressFamilyz An attempt was made to use a socket with an address family (eg I{AF_INET}, I{AF_INET6}, etc) which is not supported by the reactor. Nr,rrrrrrrrceZdZdZy)UnsupportedSocketTypez An attempt was made to use a socket of a type (eg I{SOCK_STREAM}, I{SOCK_DGRAM}, etc) which is not supported by the reactor. Nr,rrrrrrrrceZdZdZy)AlreadyListenedzd An attempt was made to listen on a file descriptor which can only be listened on once. Nr,rrrrrrrrceZdZdZdZy)InvalidAddressErrorz An invalid address was specified (i.e. neither IPv4 or IPv6, or expected one and got the other). @ivar address: See L{__init__} @ivar message: See L{__init__} c ||_||_y)z @param address: The address that was provided. @type address: L{bytes} @param message: A native string of additional information provided by the calling context. @type address: L{str} N)rmessage)rrrs rr#zInvalidAddressError.__init__s  rNrrrrrrs  rr)(rr r+r/r2r5r7r@rCrErGrJrLrNrPrRrTrVrXrZrgrirkrurzr}rrrrrrrrrrrrrr)Erra incrementalrtwisted.pythonrr:rr r+r/IOErrorr2r5r7r@rCrErGrJrLrNrPrRrTrVrXrZerrno ENETUNREACH ECONNREFUSED ETIMEDOUTrbr`r[WSAENETUNREACH ImportErrorrgrirkrsrurxrzr_r}rWarningrdeprecatedModuleAttributerrrr RuntimeErrorrrrrrAssertionErrorrrrrrrr__all__rrrrs $   0 W>Y>9"(|(9|9+<+?\?3|3?<?@l@2 2A9A0|0U)U>k>WyW  < 2 )L u'(.D U**+-9 U))* !(y % VV%N"nJzW$$ ## Ir1a :  .!$!$H9     L L > y$yIi**) _ Ls0AI//I:9I: