+
    DiJ                       ^ RI Ht ^ RIH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 ^RIHt ^RIHt ^RIHt ^RIHt ]P*                  '       d   ^ R	IHt ^R
IHt  ! R R4      t]P6                  R R l4       t ! R R]P:                  4      t ! R R4      t ! R R]P@                  4      t!R R lt" ! R R4      t# ! R R4      t$R# )    )annotationsN)TracebackType)_compat)
formatting)termui)utils)_find_binary_reader)ReadableBuffer)Commandc                      ] tR t^tR R ltR R ltR R ltRR R lltRR	 R
 lltRR R llt	R R lt
R R ltR R ltRtR# )EchoingStdinc               $    V ^8  d   QhRRRRRR/# )   input
t.BinaryIOoutputreturnNone )formats   "k/Users/tonyclaw/.openclaw/workspace/services/omi-webhook/venv/lib/python3.14/site-packages/click/testing.py__annotate__EchoingStdin.__annotate__   s!      j *      c                	,    Wn         W n        R V n        R# )FN_input_output_paused)selfr   r   s   &&&r   __init__EchoingStdin.__init__   s    r   c                    V ^8  d   QhRRRR/# )r   xstrr   t.Anyr   )r   s   "r   r   r      s     ' 'S 'U 'r   c                	.    \        V P                  V4      # N)getattrr   r    r$   s   &&r   __getattr__EchoingStdin.__getattr__   s    t{{A&&r   c                    V ^8  d   QhRRRR/# )r   rvbytesr   r   )r   s   "r   r   r   "   s       % r   c                	`    V P                   '       g   V P                  P                  V4       V# r(   )r   r   write)r    r.   s   &&r   _echoEchoingStdin._echo"   s"    |||LLr"	r   c                    V ^8  d   QhRRRR/# r   nintr   r/   r   )r   s   "r   r   r   (   s     / /c /5 /r   c                	V    V P                  V P                  P                  V4      4      # r(   )r2   r   readr    r6   s   &&r   r9   EchoingStdin.read(   s     zz$++**1-..r   c                    V ^8  d   QhRRRR/# r5   r   )r   s   "r   r   r   +   s     0 0s 0E 0r   c                	V    V P                  V P                  P                  V4      4      # r(   )r2   r   read1r:   s   &&r   r>   EchoingStdin.read1+   s     zz$++++A.//r   c                    V ^8  d   QhRRRR/# r5   r   )r   s   "r   r   r   .   s     3 3# 3u 3r   c                	V    V P                  V P                  P                  V4      4      # r(   )r2   r   readliner:   s   &&r   rB   EchoingStdin.readline.   s     zz$++..q122r   c                   V ^8  d   QhRR/# )r   r   zlist[bytes]r   )r   s   "r   r   r   1   s     @ @; @r   c                	|    V P                   P                  4        Uu. uF  qP                  V4      NK  	  up# u upi r(   )r   	readlinesr2   r*   s   & r   rF   EchoingStdin.readlines1   s/    '+{{'<'<'>?'>!

1'>???s   9c                   V ^8  d   QhRR/# )r   r   zcabc.Iterator[bytes]r   )r   s   "r   r   r   4   s     8 8. 8r   c                	B   a  \        V 3R  lS P                   4       4      # )c              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir(   )r2   ).0r$   r    s   & r   	<genexpr>(EchoingStdin.__iter__.<locals>.<genexpr>5   s     7;aDJJqMM;s   !)iterr   r    s   fr   __iter__EchoingStdin.__iter__4   s    74;;777r   c                   V ^8  d   QhRR/# r   r   r%   r   )r   s   "r   r   r   7   s     ! !# !r   c                	,    \        V P                  4      # r(   )reprr   rO   s   &r   __repr__EchoingStdin.__repr__7   s    DKK  r   r   N))__name__
__module____qualname____firstlineno__r!   r+   r2   r9   r>   rB   rF   rP   rV   __static_attributes__r   r   r   r   r      s5    
'/03@8! !r   r   c                    V ^8  d   QhRRRR/# )r   streamzEchoingStdin | Noner   zcabc.Iterator[None]r   )r   s   "r   r   r   <   s      + 0C r   c              #  F   "   V f   R x  R # RV n         R x  RV n         R # 5i)NTF)r   )r_   s   &r   _pause_echora   ;   s     ~s   !c                  V   a  ] tR t^EtRtR V 3R lltR V 3R lltR V 3R lltRtV ;t	# )	BytesIOCopyz\Patch ``io.BytesIO`` to let the written stream be copied to another.

.. versionadded:: 8.2
c                    V ^8  d   QhRRRR/# )r   copy_toz
io.BytesIOr   r   r   )r   s   "r   r   BytesIOCopy.__annotate__K   s      
 t r   c                	0   < \         SV `  4        Wn        R # r(   )superr!   re   )r    re   	__class__s   &&r   r!   BytesIOCopy.__init__K   s    r   c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   rf   O   s      t r   c                	X   < \         SV `  4        V P                  P                  4        R # r(   )rh   flushre   )r    ri   s   &r   rn   BytesIOCopy.flushO   s    r   c                    V ^8  d   QhRRRR/# )r   br
   r   r7   r   )r   s   "r   r   rf   S   s        ~  #  r   c                	X   < V P                   P                  V4       \        SV `  V4      # r(   )re   r1   rh   )r    rq   ri   s   &&r   r1   BytesIOCopy.writeS   s$    1w}Qr   re   )
rY   rZ   r[   r\   __doc__r!   rn   r1   r]   __classcell__ri   s   @r   rc   rc   E   s&    
     r   rc   c                  2    ] tR t^XtRtR R ltR R ltRtR# )StreamMixerzvMixes `<stdout>` and `<stderr>` streams.

The result is available in the ``output`` attribute.

.. versionadded:: 8.2
c                   V ^8  d   QhRR/# rl   r   )r   s   "r   r   StreamMixer.__annotate__`   s     C C$ Cr   c                	    \         P                  ! 4       V n        \        V P                  R 7      V n        \        V P                  R 7      V n        R# )rt   N)ioBytesIOr   rc   stdoutstderrrO   s   &r   r!   StreamMixer.__init__`   s/    "$**,"-dkk"B"-dkk"Br   c                   V ^8  d   QhRR/# rl   r   )r   s   "r   r   r{   e   s     
 
 
r   c                    V P                   P                  4        V P                  P                  4        V P                  P                  4        R# )z
Guarantee that embedded file-like objects are closed in a
predictable order, protecting against races between
self.output being closed and other streams being flushed on close

.. versionadded:: 8.2.2
N)r   closer   r   rO   s   &r   __del__StreamMixer.__del__e   s4     	r   )r   r   r   N)rY   rZ   r[   r\   ru   r!   r   r]   r   r   r   ry   ry   X   s    C

 
r   ry   c                  Z   a  ] tR t^rtR V 3R llt]R R l4       t]R R l4       tRtV ;t	# )_NamedTextIOWrapperc          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   bufferr   namer%   modekwargsr&   r   r   r   )r   s   "r   r    _NamedTextIOWrapper.__annotate__s   s4       (+36BG	r   c                	B   < \         SV `  ! V3/ VB  W n        W0n        R # r(   )rh   r!   _name_mode)r    r   r   r   r   ri   s   &&&&,r   r!   _NamedTextIOWrapper.__init__s   s!     	*6*

r   c                   V ^8  d   QhRR/# rS   r   )r   s   "r   r   r   {         c r   c                	    V P                   # r(   )r   rO   s   &r   r   _NamedTextIOWrapper.namez       zzr   c                   V ^8  d   QhRR/# rS   r   )r   s   "r   r   r      r   r   c                	    V P                   # r(   )r   rO   s   &r   r   _NamedTextIOWrapper.mode~   r   r   )r   r   )
rY   rZ   r[   r\   r!   propertyr   r   r]   rv   rw   s   @r   r   r   r   s5         r   r   c               $    V ^8  d   QhRRRRRR/# )r   r    str | bytes | t.IO[t.Any] | Nonecharsetr%   r   r   r   )r   s   "r   r   r      s$      +69r   c                   \        V R 4      '       d2   \        \        P                  ! RV 4      4      pVe   V# \	        R4      hV f   Rp M'\        V \        4      '       d   V P                  V4      p \        P                  ! V 4      # )r9   zt.IO[t.Any]z.Could not find binary reader for input stream.r   )
hasattrr	   tcast	TypeError
isinstancer%   encoder}   r~   )r   r   r.   s   && r   make_input_streamr      sp     uf u!=>>IHII}	E3		W%::er   c                  x    ] tR t^tRtRR R llt]R R l4       t]R R l4       t]R	 R
 l4       t	R R lt
RtR# )Resulta  Holds the captured result of an invoked CLI script.

:param runner: The runner that created the result
:param stdout_bytes: The standard output as bytes.
:param stderr_bytes: The standard error as bytes.
:param output_bytes: A mix of ``stdout_bytes`` and ``stderr_bytes``, as the
    user would see  it in its terminal.
:param return_value: The value returned from the invoked command.
:param exit_code: The exit code as integer.
:param exception: The exception that happened if one did.
:param exc_info: Exception information (exception type, exception instance,
    traceback type).

.. versionchanged:: 8.2
    ``stderr_bytes`` no longer optional, ``output_bytes`` introduced and
    ``mix_stderr`` has been removed.

.. versionadded:: 8.0
    Added ``return_value``.
Nc               8    V ^8  d   QhRRRRRRRRRRR	R
RRRR/# )r   runner	CliRunnerstdout_bytesr/   stderr_bytesoutput_bytesreturn_valuer&   	exit_coder7   	exceptionzBaseException | Noneexc_infoz?tuple[type[BaseException], BaseException, TracebackType] | Noner   )r   s   "r   r   Result.__annotate__   sZ     ! !! ! 	!
 ! ! ! (!!r   c	                	f    Wn         W n        W0n        W@n        WPn        W`n        Wpn        Wn        R # r(   r   r   r   r   r   r   r   r   )	r    r   r   r   r   r   r   r   r   s	   &&&&&&&&&r   r!   Result.__init__   s0     (((("" r   c                   V ^8  d   QhRR/# rS   r   )r   s   "r   r   r      s     	
 	
 	
r   c                    V P                   P                  V P                  P                  R4      P	                  RR4      # )zThe terminal output as unicode string, as the user would see it.

.. versionchanged:: 8.2
    No longer a proxy for ``self.stdout``. Now has its own independent stream
    that is mixing `<stdout>` and `<stderr>`, in the order they were written.
replace

)r   decoder   r   r   rO   s   &r   r   Result.output   s9       ''(;(;YGOOD
 	
r   c                   V ^8  d   QhRR/# rS   r   )r   s   "r   r   r      s     
 
 
r   c                    V P                   P                  V P                  P                  R4      P	                  RR4      # )z&The standard output as unicode string.r   r   r   )r   r   r   r   r   rO   s   &r   r   Result.stdout   s9       ''(;(;YGOOD
 	
r   c                   V ^8  d   QhRR/# rS   r   )r   s   "r   r   r      s     
 
 
r   c                    V P                   P                  V P                  P                  R4      P	                  RR4      # )zThe standard error as unicode string.

.. versionchanged:: 8.2
    No longer raise an exception, always returns the `<stderr>` string.
r   r   r   )r   r   r   r   r   rO   s   &r   r   Result.stderr   s9       ''(;(;YGOOD
 	
r   c                   V ^8  d   QhRR/# rS   r   )r   s   "r   r   r      s     4 4# 4r   c                	    V P                   '       d   \        V P                   4      MR pR\        V 4      P                   RV R2# )okay< >)r   rU   typerY   )r    exc_strs   & r   rV   Result.__repr__   s:    *....$t~~&f4:&&'q	33r   )r   r   r   r   r   r   r   r   r(   )rY   rZ   r[   r\   ru   r!   r   r   r   r   rV   r]   r   r   r   r   r      sR    *!* 	
 	
 
 
 
 
4 4r   r   c                      ] tR t^tRtRR R lltR R ltRR R llt]P                  RR	 R
 ll4       t
RR R llt]P                  RR R ll4       tRtR# )r   a  The CLI runner provides functionality to invoke a Click command line
script for unittesting purposes in a isolated environment.  This only
works in single-threaded systems without any concurrency as it changes the
global interpreter state.

:param charset: the character set for the input and output data.
:param env: a dictionary with environment variables for overriding.
:param echo_stdin: if this is set to `True`, then reading from `<stdin>` writes
                   to `<stdout>`.  This is useful for showing examples in
                   some circumstances.  Note that regular prompts
                   will automatically echo the input.
:param catch_exceptions: Whether to catch any exceptions other than
                         ``SystemExit`` when running :meth:`~CliRunner.invoke`.

.. versionchanged:: 8.2
    Added the ``catch_exceptions`` parameter.

.. versionchanged:: 8.2
    ``mix_stderr`` parameter has been removed.
Nc          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   r   r%   env$cabc.Mapping[str, str | None] | None
echo_stdinboolcatch_exceptionsr   r   r   )r   s   "r   r   CliRunner.__annotate__   s<     
1 
1
1 2
1 	
1
 
1 

1r   c                	L    Wn         T;'       g    / V n        W0n        W@n        R # r(   )r   r   r   r   )r    r   r   r   r   s   &&&&&r   r!   CliRunner.__init__   s!     25))$ 0r   c                    V ^8  d   QhRRRR/# )r   clir   r   r%   r   )r   s   "r   r   r     s     " " "S "r   c                .    VP                   ;'       g    R# )zGiven a command object it will return the default program name
for it.  The default is the `name` attribute or ``"root"`` if not
set.
root)r   )r    r   s   &&r   get_default_prog_nameCliRunner.get_default_prog_name  s    
 xx!!6!r   c                    V ^8  d   QhRRRR/# )r   	overridesr   r   zcabc.Mapping[str, str | None]r   )r   s   "r   r   r     s      =	&r   c                b    \        V P                  4      pV'       d   VP                  V4       V# )z8Returns the environment overrides for invoking a script.)dictr   update)r    r   r.   s   && r   make_envCliRunner.make_env  s%     $((^IIi 	r   c               (    V ^8  d   QhRRRRRRRR/# )	r   r   r   r   r   colorr   r   z8cabc.Iterator[tuple[io.BytesIO, io.BytesIO, io.BytesIO]]r   )r   s   "r   r   r     s9     W7 W7/W7 2W7 	W7
 
BW7r   c              #    aa"   \        WP                  4      pRp\        P                  p\        P                  p\        P
                  p\        P                  p	^P\        n        V P                  V4      p\        4       p
V P                  '       d:   \        P                  ! \        P                  \        WJP                  4      4      ;rE\        W@P                  RRR7      ;\        n        oV P                  '       d   ^Sn        \        V
P                  V P                  RRR7      \        n        \        V
P
                  V P                  RRRR	7      \        n        \#        V4      RR
 V3R lll4       p\#        V4      RR V3R lll4       p\#        V4      R R l4       pVoRR V3R lllp\$        P&                  p\$        P(                  p\$        P*                  p\,        P.                  p\0        P.                  pV\$        n        V\$        n        V\$        n        V\,        n        V\0        n        / p VP3                  4        FS  w  pp\4        P6                  P9                  V4      VV&   Vf    \4        P6                  V K@  V\4        P6                  V&   KU  	  V
P                  V
P
                  V
P<                  3x  VP3                  4        F1  w  ppVf    \4        P6                  V K  V\4        P6                  V&   K3  	  V\        n        V\        n        V\        n        V\$        n        V\$        n        V\$        n        V\,        n        V\0        n        V	\        n        R#   \:         d     EK5  i ; i  \:         d     K  i ; i  TP3                  4        FC  w  ppTf'    \4        P6                  T K    \:         d     K,  i ; iT\4        P6                  T&   KE  	  T\        n        T\        n        T\        n        T\$        n        T\$        n        T\$        n        T\,        n        T\0        n        T	\        n        i ; i5i)a  A context manager that sets up the isolation for invoking of a
command line tool.  This sets up `<stdin>` with the given input data
and `os.environ` with the overrides from the given dictionary.
This also rebinds some internals in Click to be mocked (like the
prompt functionality).

This is automatically done in the :meth:`invoke` method.

:param input: the input stream to put into `sys.stdin`.
:param env: the environment overrides as dictionary.
:param color: whether the output should contain color codes. The
              application can still override this explicitly.

.. versionadded:: 8.2
    An additional output stream is returned, which is a mix of
    `<stdout>` and `<stderr>` streams.

.. versionchanged:: 8.2
    Always returns the `<stderr>` stream.

.. versionchanged:: 8.0
    `<stderr>` is opened with ``errors="backslashreplace"``
    instead of the default ``"strict"``.

.. versionchanged:: 4.0
    Added the ``color`` parameter.
Nz<stdin>r)encodingr   r   z<stdout>wz<stderr>backslashreplace)r   r   r   errorsc                    V ^8  d   QhRRRR/# r   promptz
str | Noner   r%   r   )r   s   "r   r   )CliRunner.isolation.<locals>.__annotate__a  s     	 	* 	 	r   c                L  < \         P                  P                  T ;'       g    R 4        \        S4      P	                  R4      p\         P                  P                  T R24       \         P                  P                  4        T#   \
         d   p\        4       ThRp?ii ; i) r   Nr   )sysr   r1   nextrstripStopIterationEOFErrorrn   )r   vale
text_inputs   &  r   visible_input*CliRunner.isolation.<locals>.visible_input`  s    JJV\\r*(:&--f5 JJuBZ(JJJ	 ! (ja'(s   B B#BB#c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   l  s     	( 	( 	(s 	(r   c                
  < \         P                  P                  T ;'       g    R  R24       \         P                  P                  4         \	        S4      P                  R4      #   \         d   p\        4       ThRp?ii ; i)r   r   r   N)r   r   r1   rn   r   r   r   r   )r   r   r   s   & r   hidden_input)CliRunner.isolation.<locals>.hidden_inputk  sg    JJ"~R01JJ(J'..v66  (ja'(s   A' 'B2A==Bc                    V ^8  d   QhRRRR/# )r   echor   r   r%   r   )r   s   "r   r   r   u  s     	 	4 	C 	r   c                    \         P                  P                  ^4      pV '       d    \         P                  P	                  V4       \         P                  P                  4        V# )   )r   stdinr9   r   r1   rn   )r  chars   & r   _getchar%CliRunner.isolation.<locals>._getchart  s>    99>>!$D

  &JJKr   c               $    V ^8  d   QhRRRRRR/# )r   r_   zt.IO[t.Any] | Noner   bool | Noner   r   r   )r   s   "r   r   r     s$     	 	&	6A		r   c                (   < Vf   S'       * # V'       * # r(   r   )r_   r   default_colors   &&r   should_strip_ansi.CliRunner.isolation.<locals>.should_strip_ansi  s     }(((9r   r(   )NN)r   r   r   r  r   r   r   FORCED_WIDTHr   ry   r   r   r   BinaryIOr   r   _CHUNK_SIZEra   r   visible_prompt_funchidden_prompt_funcr  r   r  r   itemsosenvironget	Exceptionr   )r    r   r   r   bytes_input
echo_input	old_stdin
old_stdout
old_stderrold_forced_widthstream_mixerr   r   r  r  old_visible_prompt_funcold_hidden_prompt_funcold__getchar_funcold_should_strip_ansiold__compat_should_strip_ansiold_envkeyvaluer  r   s   &&&&                   @@r   	isolationCliRunner.isolation  s    D (||<
II	ZZ
ZZ
%22"$
mmC "}???'(vv

L6I6IJ( K "5,,YS"
 	
	J ??? &'J"($,,Zc

 )\\%

 
Z	 	 	 
!	 
Z	 	( 	( 
!	( 
Z	 	 
!	 	 	 #)"<"<!'!:!:"OO % 7 7(/(A(A%%2"$0!""3$5!	7!iik
U!zz~~c2=JJsO ',BJJsO *  &&(;(;\=P=PQQ%mmo
U=JJsO ',BJJsO . $CJ#CJ!CI)@F&(>F%/FO&;E#(EG%&6J#- %  % 	 &mmo
U=JJsO$  ',BJJsO . $CJ#CJ!CI)@F&(>F%/FO&;E#(EG%&6J#s   H:Q?<N <M5>N Q&N7A>Q5N N NN NQNQQ6O	Q	O	QO	A>QQc               8    V ^8  d   QhRRRRRRRRR	R
RRRRRR/# )r   r   r   argszstr | cabc.Sequence[str] | Noner   r   r   r   r   r	  r   r   extrar&   r   r   r   )r   s   "r   r   r     sd     o
 o
o
 .o
 0	o

 2o
 &o
 o
 o
 
o
r   c                   RpVf   V P                   pV P                  W4VR7      ;_uu_ 4       p	Rp
Rp^ p\        V\        4      '       d   \        P
                  ! V4      p VP                  R4      p VP                  ! RRT;'       g    RRV/VB p
\        P"                  P)                  4        \        P*                  P)                  4        V	^ ,          P-                  4       pV	^,          P-                  4       pV	^,          P-                  4       p RRR4       \/        V XXXX
XXVR7      #   \         d    T P                  T4      p Li ; i  \         d   p\        P                  ! 4       p\        P                  ! RTP                  4      pTf   ^ pT^ 8w  d   Tp\        T\         4      '       gJ   \        P"                  P%                  \        T4      4       \        P"                  P%                  R4       ^pTp Rp?ELvRp?i\&         d.   pT'       g   h Tp^p\        P                  ! 4       p Rp?ELRp?ii ; i  \        P"                  P)                  4        \        P*                  P)                  4        T	^ ,          P-                  4       pT	^,          P-                  4       pT	^,          P-                  4       pi ; i  + '       g   i     EL; i)	ak  Invokes a command in an isolated environment.  The arguments are
forwarded directly to the command line script, the `extra` keyword
arguments are passed to the :meth:`~clickpkg.Command.main` function of
the command.

This returns a :class:`Result` object.

:param cli: the command to invoke
:param args: the arguments to invoke. It may be given as an iterable
             or a string. When given as string it will be interpreted
             as a Unix shell command. More details at
             :func:`shlex.split`.
:param input: the input data for `sys.stdin`.
:param env: the environment overrides.
:param catch_exceptions: Whether to catch any other exceptions than
                         ``SystemExit``. If :data:`None`, the value
                         from :class:`CliRunner` is used.
:param extra: the keyword arguments to pass to :meth:`main`.
:param color: whether the output should contain color codes. The
              application can still override this explicitly.

.. versionadded:: 8.2
    The result object has the ``output_bytes`` attribute with
    the mix of ``stdout_bytes`` and ``stderr_bytes``, as the user would
    see it in its terminal.

.. versionchanged:: 8.2
    The result object always returns the ``stderr_bytes`` stream.

.. versionchanged:: 8.0
    The result object has the ``return_value`` attribute with
    the value returned from the invoked command.

.. versionchanged:: 4.0
    Added the ``color`` parameter.

.. versionchanged:: 3.0
    Added the ``catch_exceptions`` parameter.

.. versionchanged:: 3.0
    The result object has the ``exc_info`` attribute with the
    traceback if available.
N)r   r   r   	prog_namer*  zint | t.Any | Noner   r   r   )r   r'  r   r%   shlexsplitpopKeyErrorr   main
SystemExitr   r   r   r   coder7   r   r1   r  rn   r   getvaluer   )r    r   r*  r   r   r   r   r+  r   
outstreamsr   r   r   r-  r   e_coder   r   r   s   &&&&&&&,           r   invokeCliRunner.invoke  sM   j ##44^^%^>>*L.2II$$${{4(<!IIk2	2"xxVTZZRV9VPUV2 

  "

  "#A//1#A//1#A//1W ?Z %	
 		
G  < 66s;	<
  #<<> 4aff=>FQ; !I!&#..JJ$$S[1JJ$$T*F"	 *'		<<>* 

  "

  "#A//1#A//1#A//1W ?>>sz   3K"D14 EBK1EKEKIB&H
I
II"I :I IIBKKK	c                    V ^8  d   QhRRRR/# )r   temp_dirzstr | os.PathLike[str] | Noner   zcabc.Iterator[str]r   )r   s   "r   r   r   #  s      5	r   c              #    "   \         P                  ! 4       p\        P                  ! VR7      p\         P                  ! V4        Vx  \         P                  ! V4       Vf   ^ RIp VP                  V4       R# R#   \         d     R# i ; i  \         P                  ! T4       Tf)   ^ RIp TP                  T4       i   \         d     i i ; ii ; i5i)a  A context manager that creates a temporary directory and
changes the current working directory to it. This isolates tests
that affect the contents of the CWD to prevent them from
interfering with each other.

:param temp_dir: Create the temporary directory under this
    directory. If given, the created directory is not removed
    when exiting.

.. versionchanged:: 8.0
    Added the ``temp_dir`` parameter.
)dirN)r  getcwdtempfilemkdtempchdirshutilrmtreeOSError)r    r;  cwddtrB  s   &&   r   isolated_filesystemCliRunner.isolated_filesystem"  s       iik(+
	HHHSMMM"%	  
   HHSMMM"%   sf   ACB 
C)A> :C>B	CBCC0CCCCCCC)r   r   r   r   )zutf-8NFTr(   )NNF)NNNNF)rY   rZ   r[   r\   ru   r!   r   r   
contextlibcontextmanagerr'  r8  rG  r]   r   r   r   r   r      sT    *
1" W7 W7ro
b  r   r   )%
__future__r   collections.abcabccabcrI  r}   r  r.  r   r?  typingr   typesr   r   r   r   r   r   r	   TYPE_CHECKING	_typeshedr
   corer   r   rJ  ra   r~   rc   ry   TextIOWrapperr   r   r   r   r   r   r   <module>rU     s    "   	 	  
        (???(! !D   "**  & 4"** "(K4 K4\\ \r   