Files
ServerSync/lib/invoke/__pycache__/exceptions.cpython-314.pyc

250 lines
20 KiB
Plaintext
Raw Normal View History

2026-02-12 02:28:23 +02:00
+
t<10>i<EFBFBD>/<00><00><><00>Rt^RIHt^RIHt^RIHtHtHtH t H
t
H t ]'d^RI H t ^RIHt^RIHt!RR]4t!R R
]4t!R R ]4t!R R]4t!RR]4t!RR]4t!RR]4t!RR]4t!RR]4t!RR]4t!RR]4t!RR]4tRR lt!R!R"]4t !R#R$]4t!!R%R&]!4t"!R'R(]4t#R)#)*a
Custom exception classes.
These vary in use case from "we needed a specific data structure layout in
exceptions used for message-passing" to simply "we needed to express an error
condition in a way easily told apart from other, truly unexpected errors".
)<01>pformat)<01>format_exception)<06> TYPE_CHECKING<4E>Any<6E>Dict<63>List<73>Optional<61>Tuple)<01> ParserContext)<01>Result)<01>ExceptionWrapperc<00>2a<00>]tRt^toV3RlRltRtVtR#)<05>CollectionNotFoundc<00>*<<01>V^8<>dQhRS[RS[RR/#)<05><00>name<6D>start<72>returnN<6E><01>str)<02>format<61> __classdict__s"<22><>8/tmp/pip-target-zhdecbcm/lib/python/invoke/exceptions.py<70> __annotate__<5F>CollectionNotFound.__annotate__s"<00><><00><1B><1B>S<EFBFBD><1B><13><1B><14><1B>c<08><00>WnW nR#<00>N<>rr)<03>selfrrs&&&r<00>__init__<5F>CollectionNotFound.__init__s <00><00><18> <09><1A>
rrN)<07>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__firstlineno__r <00>__static_attributes__<5F>__classdictcell__<5F>rs@rrrs<00><><00><00><1B>rrc<00>pa<00>]tRt^toRtR V3RlRlltV3RlRltV3RlRltV3R lR
ltR t Vt
R#) <0A>Failurea<65>
Exception subclass representing failure of a command execution.
"Failure" may mean the command executed and the shell indicated an unusual
result (usually, a non-zero exit code), or it may mean something else, like
a ``sudo`` command which was aborted when the supplied password failed
authentication.
Two attributes allow introspection to determine the nature of the problem:
* ``result``: a `.Result` instance with info about the command being
executed and, if it ran to completion, how it exited.
* ``reason``: a wrapped exception instance if applicable (e.g. a
`.StreamWatcher` raised `WatcherError`) or ``None`` otherwise, in which
case, it's probably a `Failure` subclass indicating its own specific
nature, such as `UnexpectedExit` or `CommandTimedOut`.
This class is only rarely raised by itself; most of the time `.Runner.run`
(or a wrapper of same, such as `.Context.sudo`) will raise a specific
subclass like `UnexpectedExit` or `AuthFailure`.
.. versionadded:: 1.0
Nc<00>6<<01>V^8<>dQhRRRS[R,RR/#)r<00>resultr <00>reason<6F> WatcherErrorrN)r)rrs"<22>rr<00>Failure.__annotate__2s*<00><><00><1D><1D><1E><1D>(0<><1E>(@<40><1D> <0A>rc<08><00>WnW nR#r)r,r-)rr,r-s&&&rr <00>Failure.__init__2s<00><00><1D> <0B><1C> rc<00>6<<01>V^8<>dQhRS[S[S[3,/#<00>rr)r r)rrs"<22>rrr/8s<00><><00><1E><1E>U<EFBFBD>3<EFBFBD><03>8<EFBFBD>_<EFBFBD>rc <0C>6<00>RpRVPP9dTpMVPPR4pVPP'dRpW#3#RVPP9dTpW#3#VPPR4pW#3#)a<>
Return stdout/err streams as necessary for error display.
Subject to the following rules:
- If a given stream was *not* hidden during execution, a placeholder is
used instead, to avoid printing it twice.
- Only the last 10 lines of stream text is included.
- PTY-driven execution will lack stderr, and a specific message to this
effect is returned instead of a stderr dump.
:returns: Two-tuple of stdout, stderr strings.
.. versionadded:: 1.3
z already printed<65>stdoutz n/a (PTYs have no stderr)<29>stderr)r,<00>hide<64>tail<69>pty)r<00>already_printedr5r6s& r<00>streams_for_display<61>Failure.streams_for_display8s<><00><00> -<2D><0F> <13>4<EFBFBD>;<3B>;<3B>+<2B>+<2B> +<2B>$<24>F<EFBFBD><19>[<5B>[<5B>%<25>%<25>h<EFBFBD>/<2F>F<EFBFBD> <0F>;<3B>;<3B>?<3F>?<3F>?<3F>1<>F<EFBFBD> <16>~<7E><1D> <18>t<EFBFBD>{<7B>{<7B>/<2F>/<2F>/<2F>(<28><06><16>~<7E><1D><1E><1B><1B>)<29>)<29>(<28>3<><06><15>~<7E>rc<00> <<01>V^8<>dQhRS[/#r3r)rrs"<22>rrr/Vs<00><><00><1C><1C>#<23>rc<08>"<00>VP4#r)<01>_repr<70>rs&r<00>__repr__<5F>Failure.__repr__Vs<00><00><13>z<EFBFBD>z<EFBFBD>|<7C>rc<00>&<<01>V^8<>dQhRS[RS[/#<00>r<00>kwargsr<00>rr)rrs"<22>rrr/Ys<00><><00>
<EFBFBD>
<EFBFBD>c<EFBFBD>
<EFBFBD>c<EFBFBD>
rc <0C><><00>RpRpV'd.RRPRVP444,pVPVPPVP
P V4#)z@
Return ``__repr__``-like value from inner result + any kwargs.
z<{}: cmd={!r}{}><3E><00> c3<00>H"<00>TFwrRPW4x<00>K R#5i)z{}={}N)r)<03>.0<EFBFBD>key<65>values& r<00> <genexpr><3E> Failure._repr.<locals>.<genexpr>bs!<00><00><00>"<0E>=K<>z<EFBFBD>s<EFBFBD><07><0E><0E>s<EFBFBD>*<2A>*<2A>^<5E>s<00> ")<07>join<69>itemsr<00> __class__r"r,<00>command)rrE<00>template<74>rests&, rr?<00> Failure._reprYsg<00><00> &<26><08><11><04> <11><16><13><18><18>"<0E>=C<>\<5C>\<5C>^<5E>"<0E><0E><0E>D<EFBFBD><18><EFBFBD><EFBFBD> <10>N<EFBFBD>N<EFBFBD> #<23> #<23>T<EFBFBD>[<5B>[<5B>%8<>%8<>$<24>
<EFBFBD>
r)r-r,r) r"r#r$r%<00>__doc__r r;rAr?r&r'r(s@rr*r*s2<00><><00><00><08>0<1D><1D> <1E><1E><<1C><1C>
<EFBFBD>
rr*c<00>Taa<01>]tRt^jtoRtV3RlRltV3RlV3RlltRtVtV;t #)<07>UnexpectedExita`
A shell command ran to completion but exited with an unexpected exit code.
Its string representation displays the following:
- Command executed;
- Exit code;
- The last 10 lines of stdout, if it was hidden;
- The last 10 lines of stderr, if it was hidden and non-empty (e.g.
pty=False; when pty=True, stderr never happens.)
.. versionadded:: 1.0
c<00> <<01>V^8<>dQhRS[/#r3r)rrs"<22>rr<00>UnexpectedExit.__annotate__ys<00><><00>@<01>@<01><13>@rc<08><><00>VP4wrVPPpVPPpRpVP W4W4#)zZEncountered a bad command exit code!
Command: {!r}
Exit code: {}
Stdout:{}
Stderr:{}
)r;r,rS<00>exitedr)rr5r6rSr]rTs& r<00>__str__<5F>UnexpectedExit.__str__ysJ<00><00><1D>1<>1<>3<><0E><06><16>+<2B>+<2B>%<25>%<25><07><15><1B><1B>#<23>#<23><06>
<04><08><18><EFBFBD><EFBFBD>w<EFBFBD><06>?<3F>?rc<00>&<<01>V^8<>dQhRS[RS[/#rDrF)rrs"<22>rrr[<00>s<00><><00>'<27>'<27>c<EFBFBD>'<27>c<EFBFBD>'rc <08>p<<01>VPRVPP4\SV`!R/VB#)r]<00>)<05>
setdefaultr,r]<00>superr?)rrErRs&,<2C>rr?<00>UnexpectedExit._repr<70>s/<00><><00><0E><19><19>(<28>D<EFBFBD>K<EFBFBD>K<EFBFBD>$6<>$6<>7<><14>w<EFBFBD>}<7D>&<26>v<EFBFBD>&<26>&rrb)
r"r#r$r%rWr^r?r&r'<00> __classcell__<5F>rRrs@@rrYrYjs%<00><><00><00> <08>@<01>@<01>"'<27>'<27>'rrYc<00>faa<01>]tRt^<5E>toRtV3RlV3RlltV3RlRltV3RlRltRtVt V;t
#) <09>CommandTimedOutzC
Raised when a subprocess did not exit within a desired timeframe.
c<00>(<<01>V^8<>dQhRRRS[RR/#)rr,r <00>timeoutrN<><01>int)rrs"<22>rr<00>CommandTimedOut.__annotate__<5F>s"<00><><00><1F><1F>x<EFBFBD><1F>#<23><1F>$<24>rc<08>2<<01>\SV`V4W nR#r)rdr rk)rr,rkrRs&&&<26>rr <00>CommandTimedOut.__init__<5F>s<00><><00> <0A><07><18><16> <20><1E> rc<00> <<01>V^8<>dQhRS[/#r3r)rrs"<22>rrrn<00>s<00><><00>0<>0<>#<23>0rc<08>:<00>VPVPR7#)<01>rk)r?rkr@s&rrA<00>CommandTimedOut.__repr__<5F>s<00><00><13>z<EFBFBD>z<EFBFBD>$<24>,<2C>,<2C>z<EFBFBD>/<2F>/rc<00> <<01>V^8<>dQhRS[/#r3r)rrs"<22>rrrn<00>s<00><><00> F<01> F<01><13> Frc<08><><00>VP4wrVPPpRpVPVPW1V4#)zRCommand did not complete within {} seconds!
Command: {!r}
Stdout:{}
Stderr:{}
)r;r,rSrrk)rr5r6rSrTs& rr^<00>CommandTimedOut.__str__<5F>sA<00><00><1D>1<>1<>3<><0E><06><16>+<2B>+<2B>%<25>%<25><07><04><08><18><EFBFBD><EFBFBD>t<EFBFBD>|<7C>|<7C>W<EFBFBD>f<EFBFBD>E<>Errs) r"r#r$r%rWr rAr^r&r'rfrgs@@rriri<00>s0<00><><00><00><08><1F><1F>0<>0<> F<01> F<01> Frric<00>Ha<00>]tRt^<5E>toRtV3RlRltV3RlRltRtVtR#)<08> AuthFailurea
An authentication failure, e.g. due to an incorrect ``sudo`` password.
.. note::
`.Result` objects attached to these exceptions typically lack exit code
information, since the command was never fully executed - the exception
was raised instead.
.. versionadded:: 1.0
c<00>(<<01>V^8<>dQhRRRS[RR/#)rr,r <00>promptrNr)rrs"<22>rr<00>AuthFailure.__annotate__<5F>s"<00><><00><1D><1D>x<EFBFBD><1D><13><1D><14>rc<08><00>WnW nR#r)r,r{)rr,r{s&&&rr <00>AuthFailure.__init__<5F>s <00><00><1C> <0B><1C> rc<00> <<01>V^8<>dQhRS[/#r3r)rrs"<22>rrr|<00>s<00><><00>'<27>'<27><13>'rc<08><<00>RpVPVP4#)z3The password submitted to prompt {!r} was rejected.)rr{)r<00>errs& rr^<00>AuthFailure.__str__<5F>s<00><00>C<><03><12>z<EFBFBD>z<EFBFBD>$<24>+<2B>+<2B>&<26>&r)r{r,N) r"r#r$r%rWr r^r&r'r(s@rryry<00>s<00><><00><00> <08><1D><1D>'<27>'rryc<00>Faa<01>]tRt^<5E>toRtRV3RlV3RllltRtVtV;t#)<06>
ParseErrorz<EFBFBD>
An error arising from the parsing of command-line flags/arguments.
Ambiguous input, invalid task names, invalid flags, etc.
.. versionadded:: 1.0
c<00>8<<01>V^8<>dQhRS[RS[R,RR/#)r<00>msg<73>contextr
rN)rr)rrs"<22>rr<00>ParseError.__annotate__<5F>s*<00><><00><1F><1F><16><1F>!)<29>/<2F>!:<3A><1F> <0A>rc<08>2<<01>\SV`V4W nR#r)rdr r<>)rr<>r<>rRs&&&<26>rr <00>ParseError.__init__<5F>s<00><><00> <0E><07><18><13><1D><1E> r)r<>r) r"r#r$r%rWr r&r'rfrgs@@rr<>r<><00>s<00><><00><00><08><1F><1F>rr<>c<00>Va<00>]tRt^<5E>toRtRV3RlRllt]V3RlRl4tRtVt R#) <09>Exitao
Simple custom stand-in for SystemExit.
Replaces scattered sys.exit calls, improves testability, allows one to
catch an exit request without intercepting real SystemExits (typically an
unfriendly thing to do, as most users calling `sys.exit` rather expect it
to truly exit.)
Defaults to a non-printing, exit-0 friendly termination behavior if the
exception is uncaught.
If ``code`` (an int) given, that code is used to exit.
If ``message`` (a string) given, it is printed to standard error, and the
program exits with code ``1`` by default (unless overridden by also giving
``code`` explicitly.)
.. versionadded:: 1.0
Nc<00>J<<01>V^8<>dQhRS[S[,RS[S[,RR/#)r<00>message<67>coderN)rrrm)rrs"<22>rr<00>Exit.__annotate__<5F>s-<00><><00><1A><1A><1F><03>}<7D><1A>3;<3B>C<EFBFBD>=<3D><1A> <0A>rc<08><00>WnW nR#r)r<><00>_code)rr<>r<>s&&&rr <00> Exit.__init__<5F>s<00><00><1F> <0C><19>
rc<00> <<01>V^8<>dQhRS[/#r3rl)rrs"<22>rrr<><00>s<00><><00>(<28>(<28>c<EFBFBD>(rc<08>b<00>VPe VP#VP'd^#^#r<00>r<>r<>r@s&rr<><00> Exit.code<64>s)<00><00> <0F>:<3A>:<3A> !<21><17>:<3A>:<3A> <1D><18>L<EFBFBD>L<EFBFBD>L<EFBFBD>q<EFBFBD>'<27>a<EFBFBD>'rr<>)NN)
r"r#r$r%rWr <00>propertyr<79>r&r'r(s@rr<>r<><00>s(<00><><00><00><08>(<1A><1A> <0E>(<28><0E>(rr<>c<00><00>]tRt^<5E>tRtRtR#)<04> PlatformErrorz<72>
Raised when an illegal operation occurs for the current platform.
E.g. Windows users trying to use functionality requiring the ``pty``
module.
Typically used to present a clearer error message to the user.
.. versionadded:: 1.0
rbN<>r"r#r$r%rWr&rbrrr<>r<><00><00> <00><00> <08> rr<>c<00><00>]tRtRtRtRtR#)<05>AmbiguousEnvVar<61>zY
Raised when loading env var config keys has an ambiguous target.
.. versionadded:: 1.0
rbNr<4E>rbrrr<>r<><00> <00><00><08>  rr<>c<00><00>]tRtRtRtRtR#)<05>UncastableEnvVari
z<>
Raised on attempted env var loads whose default values are too rich.
E.g. trying to stuff ``MY_VAR="foo"`` into ``{'my_var': ['uh', 'oh']}``
doesn't make any sense until/if we implement some sort of transform option.
.. versionadded:: 1.0
rbNr<4E>rbrrr<>r<>
<00> <00><00><08> rr<>c<00><00>]tRtRtRtRtR#)<05>UnknownFileTypeiz]
A config file of an unknown type was specified and cannot be loaded.
.. versionadded:: 1.0
rbNr<4E>rbrrr<>r<>r<>rr<>c<00><00>]tRtRtRtRtR#)<05>UnpicklableConfigMemberi!a[
A config file contained module objects, which can't be pickled/copied.
We raise this more easily catchable exception instead of letting the
(unclearly phrased) TypeError bubble out of the pickle module. (However, to
avoid our own fragile catching of that error, we head it off by explicitly
testing for module members.)
.. versionadded:: 1.0.2
rbNr<4E>rbrrr<>r<>!r<>rr<>c<00>R<00>V^8<>dQhR\R\\\3,/#rD)rrr)rs"rrr0s"<00><00><15><15>c<EFBFBD><15>d<EFBFBD>3<EFBFBD><03>8<EFBFBD>n<EFBFBD>rc<04><><00>/pVP4Fewr#TpVR8XdT.pVFKpTp\VR4'd$\V4^
8<EFBFBD>dRpVR,V.,pVPV4KM WAV&Kg V#)z<>
Return print-friendly version of a thread-related ``kwargs`` dict.
Extra care is taken with ``args`` members which are very long iterables -
those need truncating to be useful.
<EFBFBD>args<67>__len__z2<... remainder truncated during error display ...>:N<>
N)rQ<00>hasattr<74>len<65>append)rE<00> printablerLrM<00>item<65>arg<72>new_argr<67>s& r<00>_printable_kwargsr<73>0s<><00><00><13>I<EFBFBD><1C>l<EFBFBD>l<EFBFBD>n<EFBFBD>
<EFBFBD><03><14><04> <0E>&<26>=<3D><15>D<EFBFBD><1C><03><1D><07><1A>3<EFBFBD> <09>*<2A>*<2A>s<EFBFBD>3<EFBFBD>x<EFBFBD>"<22>}<7D>N<>C<EFBFBD>!<21>#<23>h<EFBFBD>#<23><15>.<2E>G<EFBFBD><14> <0B> <0B>G<EFBFBD>$<24> <1D> <1E>#<23><0E>%<25> <15>rc<00>ba<00>]tRtRtoRt]!4tV3RlRltV3RlRltV3Rlt Rt
Vt R #)
<EFBFBD>ThreadExceptioniFal
One or more exceptions were raised within background threads.
The real underlying exceptions are stored in the `exceptions` attribute;
see its documentation for data structure details.
.. note::
Threads which did not encounter an exception, do not contribute to this
exception object and thus are not present inside `exceptions`.
.. versionadded:: 1.0
c<00>2<<01>V^8<>dQhRS[R,RR/#)r<00>
exceptionsr rN)r)rrs"<22>rr<00>ThreadException.__annotate__bs!<00><><00>,<2C>,<2C>4<EFBFBD>(:<3A>#;<3B>,<2C><04>,rc<08>&<00>\V4VnR#r)<02>tupler<65>)rr<>s&&rr <00>ThreadException.__init__bs<00><00><1F>
<EFBFBD>+<2B><04>rc<00> <<01>V^8<>dQhRS[/#r3r)rrs"<22>rrr<>es<00><><00>
<EFBFBD>
<EFBFBD><13>
rc <08><><00>.pVPFzpRpVPVP\\ VP
44RP \VPVPVP4444K| \VP4RP RVP44RP V43pRP!V!#)zThread args: {}
{}<7D>
z, c3<00>L"<00>TFqPPx<00>K R#5ir)<02>typer")rK<00>xs& rrN<00>*ThreadException.__str__.<locals>.<genexpr>rs<00><00><00>?<3F><EFBFBD>!<21>f<EFBFBD>f<EFBFBD>o<EFBFBD>o<EFBFBD><EFBFBD>s<00>"$z
z-
Saw {} exceptions within threads ({}):
{}
) r<>r<>rrr<>rErPrr<>rM<00> tracebackr<6B>)r<00>detailsr<73><00>detailr<6C>s& rr^<00>ThreadException.__str__es<><00><00><14><07><15><1F><1F>A<EFBFBD>,<2C>F<EFBFBD> <13>N<EFBFBD>N<EFBFBD><16> <0A> <0A><1B>-<2D>a<EFBFBD>h<EFBFBD>h<EFBFBD>7<>8<><18>I<EFBFBD>I<EFBFBD>.<2E>q<EFBFBD>v<EFBFBD>v<EFBFBD>q<EFBFBD>w<EFBFBD>w<EFBFBD><01> <0B> <0B>L<>M<><12> <0E>!<21> <10><04><0F><0F> <20> <10>I<EFBFBD>I<EFBFBD>?<3F>t<EFBFBD><EFBFBD><EFBFBD>?<3F> ?<3F> <12>K<EFBFBD>K<EFBFBD><07> <20>
<EFBFBD><04>
<04>
 <0B>F<EFBFBD>  <0B> <12> 
<EFBFBD>
rc<00>4<<01>V^8<>dQh/S[R,;R&#)rr<>)r .)r )rrs"<22>rrr<>Fs<00><><00><00>4<16>-<2D>.<2E>8<>5r)r<>N) r"r#r$r%rWr<>r<>r r^<00>__annotate_func__r&r'r(s@rr<>r<>Fs.<00><><00><00> <08>227<32><17>J<EFBFBD>,<2C>,<2C>
<EFBFBD>
<EFBFBD>?<01>rr<>c<00><00>]tRtRtRtRtR#)r.ia<>
Generic parent exception class for `.StreamWatcher`-related errors.
Typically, one of these exceptions indicates a `.StreamWatcher` noticed
something anomalous in an output stream, such as an authentication response
failure.
`.Runner` catches these and attaches them to `.Failure` exceptions so they
can be referenced by intermediate code and/or act as extra info for end
users.
.. versionadded:: 1.0
rbNr<4E>rbrrr.r.s <00><00> <08> rr.c<00><00>]tRtRtRtRtR#)<05>ResponseNotAcceptedi<64>z<>
A responder/watcher class noticed a 'bad' response to its submission.
Mostly used by `.FailingResponder` and subclasses, e.g. "oh dear I
autosubmitted a sudo password and it was incorrect."
.. versionadded:: 1.0
rbNr<4E>rbrrr<>r<><00>r<>rr<>c<00><00>]tRtRtRtRtR#)<05>SubprocessPipeErrori<72>a 
Some problem was encountered handling subprocess pipes (stdout/err/in).
Typically only for corner cases; most of the time, errors in this area are
raised by the interpreter or the operating system, and end up wrapped in a
`.ThreadException`.
.. versionadded:: 1.3
rbNr<4E>rbrrr<>r<><00>s <00><00><08> rr<>N)$rW<00>pprintrr<>r<00>typingrrrrrr <00>parserr
<00>runnersr <00>utilr <00> Exceptionrr*rYriryr<>r<>r<>r<>r<>r<>r<>r<>r<>r.r<>r<>rbrr<00><module>r<>s<><00><01><04><1B>&<26>B<>B<><10>%<25><1F>&<26><1B><19><1B> N
<EFBFBD>i<EFBFBD>N
<EFBFBD>b"'<27>W<EFBFBD>"'<27>JF<01>g<EFBFBD>F<01>6'<27>'<27>'<27>* <1F><19> <1F> (<28>9<EFBFBD>(<28>D  <09>I<EFBFBD>  <09> <09>i<EFBFBD> <09>
 <09>y<EFBFBD>
 <09> <09>i<EFBFBD> <09>  <09>i<EFBFBD>  <09><15>,6
<EFBFBD>i<EFBFBD>6
<EFBFBD>r <09>9<EFBFBD> <09>$
 <09>,<2C>
 <09>  <09>)<29>  r