+
    ژ*jud                       ^ 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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 ]P6                  R,          t ! R R4      t]P<                  R R l4       t ! R R4      t  ! R R]PB                  4      t" ! R R4      t# ! R R]PH                  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   "-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   1   s     3 3# 3u 3r   c                	V    V P                  V P                  P                  V4      4      # r(   )r2   r   readliner:   s   &&r   rB   EchoingStdin.readline1   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   4   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.readlines4   s/    '+{{'<'<'>?'>!

1'>???s   9c                   V ^8  d   QhRR/# )r   r   zcabc.Iterator[bytes]r   )r   s   "r   r   r   7   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>8   s     7;aDJJqMM;s   !)iterr   r    s   fr   __iter__EchoingStdin.__iter__7   s    74;;777r   c                   V ^8  d   QhRR/# r   r   r%   r   )r   s   "r   r   r   :   s     ! !# !r   c                	,    \        V P                  4      # r(   )reprr   rO   s   &r   __repr__EchoingStdin.__repr__:   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                  >    ] tR t^HtRtR R ltR R ltR R ltRtR	# )

_FDCapturea>  Redirect a file descriptor to a temporary file for capture.

Saves the current target of *targetfd* via :func:`os.dup`, then
redirects it to a temporary file via :func:`os.dup2`. On
:meth:`stop`, restores the original ``fd`` and returns the captured
bytes. Inspired by Pytest's ``FDCapture``.

.. versionadded:: 8.4.0
c                    V ^8  d   QhRRRR/# )r   targetfdr7   r   r   r   )r   s   "r   r   _FDCapture.__annotate__S   s     0 0 0 0r   c                	.    Wn         RV n        RV n        R#    NrX   )	_targetfdsaved_fd_tmpfile)r    re   s   &&r   r!   _FDCapture.__init__S   s    !+/r   c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   rf   X   s     8 8t 8r   c                	    \         P                  ! V P                  4      V n        \        P
                  ! ^ R7      V n        \         P                  ! V P                  P                  4       V P                  4       R# )r   )	bufferingN)	osduprj   rk   tempfileTemporaryFilerl   dup2filenorO   s   &r   start_FDCapture.startX   sG    t~~. ..;
$$&7r   c                   V ^8  d   QhRR/# )r   r   r/   r   )r   s   "r   r   rf   ]   s     	 	e 	r   c                	   V P                   f   Q R4       h\        P                  ! V P                  V P                  4       \        P
                  ! V P                  4       RV n        V P                   P                  ^ 4       V P                   P                  4       pV P                   P                  4        R V n         V# )Nz!_FDCapture.start() was not calledrX   )rl   rr   rv   rk   rj   closeseekr9   )r    datas   & r   stop_FDCapture.stop]   s    }}(M*MM(
t~~.
1}}!!#r   )rj   rl   rk   N)	rY   rZ   r[   r\   __doc__r!   rx   r   r]   r   r   r   rc   rc   H   s    0
8
	 	r   rc   c                  V   a  ] tR t^it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__o   s      
 t r   c                	0   < \         SV `  4        Wn        R # r(   )superr!   r   )r    r   	__class__s   &&r   r!   BytesIOCopy.__init__o   s    r   c                   V ^8  d   QhRR/# ro   r   )r   s   "r   r   r   s   s      t r   c                	X   < \         SV `  4        V P                  P                  4        R # r(   )r   flushr   r    r   s   &r   r   BytesIOCopy.flushs   s    r   c                    V ^8  d   QhRRRR/# )r   br
   r   r7   r   )r   s   "r   r   r   w   s        ~  #  r   c                	X   < V P                   P                  V4       \        SV `  V4      # r(   )r   r1   r   )r    r   r   s   &&r   r1   BytesIOCopy.writew   s$    1w}Qr   r   )
rY   rZ   r[   r\   r   r!   r   r1   r]   __classcell__r   s   @r   r   r   i   s&    
     r   r   c                  &    ] tR t^|tR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/# ro   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# )r   N)ioBytesIOr   r   stdoutstderrrO   s   &r   r!   StreamMixer.__init__   s/    "$**,"-dkk"B"-dkk"Br   )r   r   r   N)rY   rZ   r[   r\   r   r!   r]   r   r   r   r   r   |   s    C Cr   r   c                  |   a  ] tR t^tRtR V 3R lltR R ltR V 3R llt]R R	 l4       t	]R
 R l4       t
RtV ;t# )_NamedTextIOWrappera  A :class:`~io.TextIOWrapper` with custom ``name`` and ``mode``
that does not close its underlying buffer.

When ``CliRunner`` runs in ``fd`` mode, ``_original_fd`` is patched to
point at the saved (pre-redirection) ``fd``, so C-level consumers that call
:meth:`fileno` (like ``faulthandler`` or ``subprocess``) keep working. In
the default ``sys`` mode ``_original_fd`` stays at ``-1`` and
:meth:`fileno` raises :exc:`io.UnsupportedOperation`, matching the
pre-``8.3.3`` behavior.
c          
     ,    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<     
$ 
$
$ 
$ 	
$
 
$ 

$r   c                	P   < \         SV `  ! V3/ VB  W n        W0n        RV n        R# rh   )r   r!   _name_mode_original_fd)r    r   r   r   r   r   s   &&&&,r   r!   _NamedTextIOWrapper.__init__   s)     	*6*

!#r   c                   V ^8  d   QhRR/# ro   r   )r   s   "r   r   r      s      t r   c                    R# )zThe buffer this object contains belongs to some other object,
so prevent the default ``__del__`` implementation from closing
that buffer.

.. versionadded:: 8.3.2
Nr   rO   s   &r   r|   _NamedTextIOWrapper.close   s    r   c                   V ^8  d   QhRR/# )r   r   r7   r   )r   s   "r   r   r      s          r   c                Z   < V P                   ^ 8  d   V P                   # \        SV `	  4       # )zReturn the file descriptor of the saved original stream when
``CliRunner`` runs in ``fd`` mode. Otherwise delegate to
:class:`~io.TextIOWrapper`, which raises
:exc:`io.UnsupportedOperation` for a ``BytesIO``-backed buffer.
)r   r   rw   r   s   &r   rw   _NamedTextIOWrapper.fileno   s,     !$$$w~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.name       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   r   )rY   rZ   r[   r\   r   r!   r|   rw   propertyr   r   r]   r   r   s   @r   r   r      sI    	
$ 
$       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\   r   r!   r   r   r   r   rV   r]   r   r   r   r   r      sR    *!* 	
 	
 
 
 
 
4 4r   r   c                      ] tR tR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   i  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`.
:param capture: Selects the output capture strategy. ``sys`` (default)
    captures Python-level writes only and leaves
    :meth:`sys.stdout.fileno` raising :exc:`io.UnsupportedOperation`, so
    user code that calls :func:`os.dup2` on ``sys.stdout.fileno()`` cannot
    clobber the host runner's stdout. ``fd`` redirects file descriptors
    ``1`` and ``2`` via :func:`os.dup2` to a temporary file, also catching
    output from stale stream references, C extensions, and subprocesses.
    ``fd`` is not supported on Windows.

.. versionchanged:: 8.4.0
    Added the ``capture`` parameter. The default ``sys`` mode no longer
    exposes the original fd through :meth:`fileno`, reverting the change
    introduced in ``8.3.3`` that broke Pytest's ``fd``-level capture
    teardown. Use ``capture="fd"`` to restore that behavior with proper
    isolation. :issue:`3384`

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

.. versionchanged:: 8.2
    ``mix_stderr`` parameter has been removed.
Nc               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r   r   r%   env$cabc.Mapping[str, str | None] | None
echo_stdinboolcatch_exceptionscaptureCaptureModer   r   r   )r   s   "r   r   CliRunner.__annotate__D  sF     , ,, 2, 	,
 , , 
,r   c                	    VR9  d   \        RV: R24      hVR8X  d&   \        P                  R8X  d   \        RV: R24      hWn        T;'       g    / V n        W0n        W@n        WPn        R# )sysfdzcapture=z) is not valid. Choose from 'sys' or 'fd'.win32z( is not supported on Windows. Use 'sys'.N>   r   r   )
ValueErrorr   platformr   r   r   r   r   )r    r   r   r   r   r   s   &&&&&&r   r!   CliRunner.__init__D  sx     -'7+%NO  d?s||w67+%MN  25))$ 0$+r   c                    V ^8  d   QhRRRR/# )r   clir   r   r%   r   )r   s   "r   r   r   Z  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_nameZ  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   a  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_enva  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   k  s9     C, C,/C, 2C, 	C,
 
BC,r   c              #  	  a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\2        P4                  P6                  oV\$        n        V\$        n        V\$        n        V\,        n        V\0        n        RR V3R lllpV\2        P4                  n        / p VP9                  4        FS  w  pp\:        P<                  P?                  V4      VV&   Vf    \:        P<                  V K@  V\:        P<                  V&   KU  	  V
P                  V
P
                  V
PB                  3x  VP9                  4        F1  w  ppVf    \:        P<                  V K  V\:        P<                  V&   K3  	  V\        n        V\        n        V\        n        V\$        n        V\$        n        V\$        n        V\,        n        V\0        n        V	\        n        S\2        P4                  n        R#   \@         d     EKJ  i ; i  \@         d     K  i ; i  TP9                  4        FC  w  ppTf'    \:        P<                  T K    \@         d     K,  i ; iT\:        P<                  T&   KE  	  T\        n        T\        n        T\        n        T\$        n        T\$        n        T\$        n        T\,        n        T\0        n        T	\        n        S\2        P4                  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__  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   )r   r   r1   nextrstripStopIterationEOFErrorr   )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    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   r   r  r  r  r  )r  r  r   s   & r   hidden_input)CliRunner.isolation.<locals>.hidden_input  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    s     	 	4 	C 	r   c                    \         P                  P                  ^4      pV '       d    \         P                  P	                  V4       \         P                  P                  4        V# )ri   )r   stdinr9   r   r1   r   )r(  chars   & r   _getchar%CliRunner.isolation.<locals>._getchar  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   c               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r   r    zpdb.Pdbcompletekeyr%   r*  zt.IO[str] | Noner   r   r&   r   r   r   )r   s   "r   r   r    sD     #	 #	#	#	 $#	 %	#	
 #	 #	r   c           	     v   < Vf   \         P                  pVf   \         P                  pS! V 3RVRVRV/VB  R# )a  Default ``pdb.Pdb`` to real terminal streams during
``CliRunner`` isolation.

Without this patch, ``pdb.Pdb.__init__`` inherits from
``cmd.Cmd`` which falls back to ``sys.stdin``/``sys.stdout``
when no explicit streams are provided. During isolation
those are ``BytesIO``-backed wrappers, so the debugger
reads from an empty buffer and writes to captured output,
making interactive debugging impossible.

By defaulting to ``sys.__stdin__``/``sys.__stdout__`` (the
original terminal streams Python preserves regardless of
redirection), debuggers can interact with the user while
``click.echo`` output is still captured normally.

This covers ``pdb.set_trace()``, ``breakpoint()``,
``pdb.post_mortem()``, and debuggers that subclass
``pdb.Pdb`` (ipdb, pdbpp). Explicit ``stdin``/``stdout``
arguments are honored and not overridden. Debuggers that
do not subclass ``pdb.Pdb`` (pudb, debugpy) are not
covered.
Nr5  r*  r   )r   	__stdin__
__stdout__)r    r5  r*  r   r   old_pdb_inits   &&&&,r   _patched_pdb_init.CliRunner.isolation.<locals>._patched_pdb_init  sL    : }~"-5:CIMSr   r(   )NN)tabNN)"r   r   r   r*  r   r   r   FORCED_WIDTHr
  r   r   r   r   BinaryIOr   r   _CHUNK_SIZEra   r   visible_prompt_funchidden_prompt_funcr,  r   r2  r   pdbPdbr!   itemsrr   environget	Exceptionr   )r    r   r   r  bytes_input
echo_input	old_stdin
old_stdout
old_stderrold_forced_widthstream_mixerr!  r%  r,  r2  old_visible_prompt_funcold_hidden_prompt_funcold__getchar_funcold_should_strip_ansiold__compat_should_strip_ansir:  old_envkeyvaluer1  r9  r   s   &&&&                    @@@r   	isolationCliRunner.isolationj  s    D (||<
II	ZZ
ZZ
%22"$
mmC "}???'(vv

L6I6IJ( K "5,,YS"
 	
	J ??? &'J"(\\	

 )\\%

 
Z	 	 	 
!	 
Z	 	( 	( 
!	( 
Z	 	 
!	 	 	 #)"<"<!'!:!:"OO % 7 7(/(A(A%ww''%2"$0!""3$5!#	 #	J -	,!iik
U!zz~~c2=JJsO ',BJJsO *  &&(;(;\=P=PQQ%mmo
U=JJsO ',BJJsO . $CJ#CJ!CI)@F&(>F%/FO&;E#(EG%&6J#+CGG/ %  % 	 &mmo
U=JJsO$  ',BJJsO . $CJ#CJ!CI)@F&(>F%/FO&;E#(EG%&6J#+CGGs   I4R>:<O* 7O>O* R>!O2BR>OO* OO* O'#R>&O''R>*R;PR;P(	$R;'P(	(BR;;R>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   0  sd     O
 O
O
 .O
 0	O

 2O
 &O
 O
 O
 
O
r   c                   RpVf   V P                   pRp	Rp
V P                  R8X  d8   \        ^4      p	\        ^4      p
 V	P                  4        V
P                  4        V P                  W4VR7      ;_uu_ 4       pV	eC   V
e?   V	P                  \        P                  n	        V
P                  \        P                  n	        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                  P7                  4        \        P                  P7                  4        V	ee   V
ea   V	P9                  4       pV
P9                  4       pV'       d   V^ ,          P3                  V4       V'       d   V^,          P3                  V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    R;r ELi ; i  \          d    T P#                  T4      p ELZi ; i  \&         d   p\        P(                  ! 4       p\*        P,                  ! RTP.                  4      pTf   ^ pT^ 8w  d   Tp\        T\0        4      '       gJ   \        P                  P3                  \        T4      4       \        P                  P3                  R4       ^pTp Rp?ELRp?i\4         d.   pT'       g   h Tp^p\        P(                  ! 4       p Rp?EL*Rp?ii ; i  \        P                  P7                  4        \        P                  P7                  4        T	ee   T
ea   T	P9                  4       pT
P9                  4       pT'       d   T^ ,          P3                  T4       T'       d   T^,          P3                  T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.
Nr   )r   r   r  	prog_namerZ  zint | t.Any | Noner   r   r   )r   r   rc   rx   OSErrorrW  rk   r   r   r   r   r   r%   shlexsplitpopKeyErrorr  main
SystemExitr   r   r   coder7   r1   rG  r   r   getvaluer   )r    r   rZ  r   r   r   r  r[  r   cap_outcap_err
outstreamsr   r   r   r]  r  e_codefd_outfd_errr   r   r   s   &&&&&&&,               r   invokeCliRunner.invoke0  su   j ##44 &*%)<<4 mG mG) ^^%^>>* "w':*1*:*:

'*1*:*:

'L.2II$$${{4(<!IIk2	*2"xxVTZZRV9VPUV2 

  "

  "
 &7+>$\\^F$\\^F"1++F3"1++F3#A//1#A//1#A//1} ?@ %	
 		
G  )$((')(  < 66s;	<
  #<<> 4aff=>FQ; !I!&#..JJ$$S[1JJ$$T*F"	 *'		<<>* 

  "

  "
 &7+>$\\^F$\\^F"1++F3"1++F3#A//1#A//1#A//1} ?>>s    H+ :A9Q4I  I#&A+QQ2AQ+H=<H= I QI  Q#M.B&LMM'M("M
MMMA,QQ%AQQQ	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)rr   getcwdrt   mkdtempchdirshutilrmtreer^  )r    rp  cwddtrv  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   r   )zutf-8NFTr   r(   )NNF)NNNNF)rY   rZ   r[   r\   r   r!   r  r
  
contextlibcontextmanagerrW  rm  rz  r]   r   r   r   r   r     sU    "H,," C, C,JO
b  r   r   )r   r   ))
__future__r   collections.abcabccabcr|  r   rr   rB  r_  r   rt   typingr   typesr   r  r   r   r   r   r	   TYPE_CHECKING	_typeshedr
   corer   Literalr   r   r}  ra   rc   r   r   r   TextIOWrapperr   r   r   r   r   r   r   <module>r     s    "   	 	 
  
        (???(ii$! !D   B "**  &C C0"** 0f(K4 K4\A Ar   