+
    :1j]<                        R t ^ RIHt ^ RIt^ RIt^ RIHtHt ^ RIH	t	 ^ RI
Ht ^RIHtHt ^RIHt ]'       d   ^ RIHt ^ R	IHt ^ R
I
HtHt ]! R4      t]	! ]4      t ! R R4      tR R ltR# )z#Error handling and error reporting.)annotationsN)cached_propertypartial)	getLogger)TYPE_CHECKING)ensure_text_typeon_win)
deprecated)Callable)TracebackType)AnyTypeVarTc                  |   ] tR t^tR R ltR R lt]R 4       t]R 4       t]]	! RR4      R	 4       4       t
R
 R ltR R ltR R ltR R ltR R ltR R ltR R ltR R lt]R R l4       t]	! RR4      R R l4       t]	! RR4      R R l4       t]	! RR4      R  R! l4       t]	! RR4      R" R# l4       tR$tR%# )&ExceptionHandlerc                    V ^8  d   QhRRRR/#    funczCallable[..., T]returnzT | int )formats   "7lib/python3.14/site-packages/conda/exception_handler.py__annotate__ExceptionHandler.__annotate__   s     : :- :7 :    c                	t     V! V/ VB #    \         P                  ! 4       w  rEpT P                  YV4      u # ; iN)sysexc_infohandle_exception)selfr   argskwargs_exc_valexc_tbs   &&*,   r   __call__ExceptionHandler.__call__   s?    	:(((	:!$A((99s   
 +7c                    V ^8  d   QhRRRR/# )r   contentstrr   Noner   )r   s   "r   r   r   #   s     # ## #$ #r   c                	Z    ^RI Hp ^RIHp V! 4        V! RP	                  V4      4       R# )   )init_loggers)stderr
N)cli.mainr/   gateways.streamsr0   join)r!   r*   r/   r0   s   &*  r   	write_outExceptionHandler.write_out#   s    *,tyy!"r   c                	>    ^RI Hp VP                  VP                  3# r.   context)base.contextr:   remote_connect_timeout_secsremote_read_timeout_secsr!   r:   s   & r   http_timeoutExceptionHandler.http_timeout*   s    )22G4T4TTTr   c                	&    ^RI Hp VP                  # r8   )r;   r:   
user_agentr>   s   & r   rB   ExceptionHandler.user_agent0   s    )!!!r   z26.9z27.3c                	&    ^RI Hp VP                  # r8   )r;   r:   error_upload_urlr>   s   & r   rE   !ExceptionHandler.error_upload_url6   s     	*'''r   c               $    V ^8  d   QhRRRRRR/# r   r%   BaseExceptionr&   r   r   intr   )r   s   "r   r   r   @   s'     !A !A !A} !AQT !Ar   c                	   ^ RI Hp ^RIHpHpHp  ^RIHp VP                  P                  W4       \        W4      '       d5   VP                  '       d   V P                  W4      # V P!                  W4      # \        V\"        4      '       d+   \%        VRR4      V8X  d   V P!                  V! V4      V4      # \        V\&        4      '       d   V P!                  V! V4      V4      # \        V\(        4      '       d   V P+                  V! R	4      V4       ^# \        V\,        4      '       d   VP.                  # V P1                  W4      #   \         d    \        P                  RRR7        EL;i ; i)
    )ENOSPC)
CondaErrorCondaMemoryErrorNoSpaceLeftErrorr9   z+Failed to invoke exception observer pluginsTr   errnoNKeyboardInterrupt)rR   rM   
exceptionsrN   rO   rP   r;   r:   plugin_managerinvoke_exception_observersrI   logdebug
isinstance
reportable'handle_reportable_application_exceptionhandle_application_exceptionEnvironmentErrorgetattrMemoryErrorrS   _print_conda_exception
SystemExitcodehandle_unexpected_exception)r!   r%   r&   rM   rN   rO   rP   r:   s   &&&     r   r    !ExceptionHandler.handle_exception@   s?    	
 	
	T-""==gN g**!!!CCGTT88IIg/00w.&888$W-v  g{++445Eg5NPVWWg011''
3F(GPgz**<<//@@)  	TIICdIS	Ts   !E	 	"E/.E/c               $    V ^8  d   QhRRRRRR/# rH   r   )r   s   "r   r   r   c   s$     # #$#.;#	#r   c                	<    V P                  W4       VP                  # r   )r`   return_code)r!   r%   r&   s   &&&r   r\   -ExceptionHandler.handle_application_exceptionc   s     	##G4"""r   c               $    V ^8  d   QhRRRRRR/# )r   r%   rI   r&   r   r   r,   r   )r   s   "r   r   r   i   s(     / // / 
	/r   c                	"    ^RI Hp V! W4       R# )r.   )print_conda_exceptionN)rT   rk   )r!   r%   r&   rk   s   &&& r   r`   'ExceptionHandler._print_conda_exceptioni   s    
 	6g.r   c               $    V ^8  d   QhRRRRRR/# rH   r   )r   s   "r   r   r   r   s$     + +$+.;+	+r   c                	p    V P                  W4      pV P                  V4       \        VR R4      pVe   V# ^# )rg   N)get_error_reportprint_unexpected_error_reportr^   )r!   r%   r&   error_reportrcs   &&&  r   rc   ,ExceptionHandler.handle_unexpected_exceptionr   s?     ,,W=**<8WmT2^r**r   c               $    V ^8  d   QhRRRRRR/# rH   r   )r   s   "r   r   r   z   s$     	# 	#$	#.;	#		#r   c                	    V P                  W4      p^RIHp VP                  '       d    VP	                  VP                  4       4       V P                  V4       VP                  # r8   )ro   r;   r:   jsonupdatedump_mapprint_expected_error_reportrg   )r!   r%   r&   rq   r:   s   &&&  r   r[   8ExceptionHandler.handle_reportable_application_exceptionz   sQ     ,,W=)<<< 0 0 23((6"""r   c               $    V ^8  d   QhRRRRRR/# )r   r%   rI   r&   r   r   dict[str, str]r   )r   s   "r   r   r      s(     % %% % 
	%r   c                	   ^RI HpHp RP                  R \        P
                   4       4      p/ pRV9  d    ^RIHp V! 4       pR\        V4      RVP                  P                  R\        VP                  4      RVR	V! W4      RV/p
\        W4      '       d   VP                  4       V
R&   V
#   \         dL   pT! 4       p	R\        T4      RTP                  P                  R\        TP                  4      R	T	/p R
p?LR
p?ii ; i)r.   )rN   _format_exc c              3  8   "   T F  p\        V4      x  K  	  R # 5ir   )r   ).0ss   & r   	<genexpr>4ExceptionHandler.get_error_report.<locals>.<genexpr>   s     A1+A..s   z info)get_info_dicterrorexception_nameexception_type	tracebackNcommand
conda_infoconda_error_components)rT   rN   r~   r4   r   argvcli.main_infor   	Exceptionrepr	__class____name__r+   rY   rx   )r!   r%   r&   rN   r~   r   	info_dictr   info_einfo_tracebackrq   s   &&&        r   ro   !ExceptionHandler.get_error_report   s    
 	8((AAA	'!8)O	 T']g//88c'"3"34wW5)
 g**5<5E5E5GL12+  !,T&\$f&6&6&?&?$c'*;*;&<		s   B0 0D;ADDc                    V ^8  d   QhRRRR/# r   rq   r|   r   r,   r   )r   s   "r   r   r      s     2- 2-. 2-T 2-r   c                	B   ^RI Hp VP                  '       d   ^RIHp V! V4       R# . pVP                  R4       VP                  R4       VP                  R4       VP                  R VR,          P                  4        4       4       VP                  R4       VP                  RP                  VR,          4      4       VP                  R4       VR	,          '       dF   ^R
I	H
pHp  VP                  V! VR	,          4      4       VP                  V! VR	,          4      4       VP                  . RO4       V P                  ! V!   R#   \         dG   p\        P                  RTRR7       TP                  R4       TP                  T: 4        Rp?LqRp?ii ; i)r.   r9   stdout_json <# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<c              3  4   "   T F  pR V,           x  K  	  R# 5i)z    Nr   )r   lines   & r   r   AExceptionHandler.print_unexpected_error_report.<locals>.<genexpr>   s      #*P$*Ps   r   `$ {}`r   r   get_env_vars_strget_main_info_str%rTrQ   $conda info could not be constructed.N)r   zFAn unexpected error has occurred. Conda has prepared the above report.zEIf you suspect this error is being caused by a malfunctioning plugin,z;consider using the --no-plugins option to turn off plugins.r   z-Example: conda --no-plugins install <package>r   zGAlternatively, you can set the CONDA_NO_PLUGINS environment variable onz<the command line to run the command without plugins enabled.r   z6Example: CONDA_NO_PLUGINS=true conda install <package>r   )r;   r:   rv   
cli.commonr   appendextend
splitlinesr   r   r   r   r   rW   warningr5   r!   rq   r:   r   message_builderr   r   es   &&      r   rp   .ExceptionHandler.print_unexpected_error_report   s`   )<<</% O""2&""N ""2&"" #*6{*C*N*N*P#  ""2&""8??<	3J#KL""2&L))N	5#**+;L<V+WX#**),|*DE """ NNO,+ ! 5KKa$K7#**+QR#**aU445s   ,<E F<FFc                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r      s     *- *- *-4 *-r   c                	   ^RI Hp VP                  '       d   ^RIHp V! V4       R# . pVP                  R4       VP                  R4       VP                  R4       VP                  RP                  VR,          4      4       VP                  R4       VR,          '       dF   ^RIHpH	p  VP                  V! VR,          4      4       VP                  V! VR,          4      4       VP                  R4       VP                  R4       VP                  R4       VP                  VR,          P                  4       4       VP                  R4       VP                  R4       VP                  R4       V P                  ! V!   R#   \         dG   p\        P                  R	TR
R7       TP                  R4       TP                  T: 4        Rp?LRp?ii ; i)r.   r9   r   r   r   r   r   r   r   r   TrQ   r   Nz=V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V Vr   zQA reportable application error has occurred. Conda has prepared the above report.)r;   r:   rv   r   r   r   r   r   r   r   r   rW   r   r   r   r5   r   s   &&      r   ry   ,ExceptionHandler.print_expected_error_report   s   )<<</% O""2&""N ""2&""8??<	3J#KL""2&L))N	5#**+;L<V+WX#**),|*DE ""2&""O ""2&""<#8#C#C#EF""2&""c ""2&NNO,# ! 5KKa$K7#**+QR#**aU445s   .<F G<GGc                   V ^8  d   QhRR/# r   r   boolr   )r   s   "r   r   r     s       r   c                	     \         P                  ! ^ 4      ;'       g    \        #   \         d"   p\        P                  RT4        Rp?R# Rp?ii ; i)rL   r   NT)osisattyr   r   rW   rX   )r!   r   s   & r   _isattyExceptionHandler._isatty  s>    	99Q<))6) 	IIdA	s   & & AAAc                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r     s     ) )N )t )r   c                   ^RI Hp RpVP                  RJ d   RpMVP                  RJ g   VP                  '       d   RpMwVP                  '       g%   VP
                  '       g   V P                  '       g0   \        VP                  '       * ;'       d    VP                  4      pMV P                  4       pRpV'       d   V P                  V4       V'       d   V P                  V4       R# R# )z4Determine whether or not to upload the error report.r9   FTN)r;   r:   report_errors
always_yesrv   quietr   r   offline_ask_upload_execute_upload_post_upload)r!   rq   r:   post_upload	do_uploads   &&   r   _uploadExceptionHandler._upload  s     	*  E)I""d*g.@.@.@I\\\W]]]$,,,0GGW5G5GHI ((*IK   .i( r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   <  s      T r   c                	    ^RI Hp ^RIHp  V! ^(\	        \
        R4      4      pT;'       d	    V! V4      #   \         d"   p\        P                  RT4        Rp?R# Rp?ii ; i)r.   )boolify)timeoutzIf submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers? [y/N]: r   NF)	auxlib.type_coercionr   	common.ior   r   inputr   rW   rX   )r!   r   r   r   r   s   &    r   r   ExceptionHandler._ask_upload8  sb    
 	2&		I 33!33 	IIdA	s   7 7 A#AA#c                    V ^8  d   QhRRRR/# )r   rq   zdict[str, Any]r   r,   r   )r   s   "r   r   r   T  s     9 9N 9t 9r   c                	   ^ RI p^RIHp RV P                  /pV P                  pVP                  4       p\        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       d   RMRVR&   R\        V4      9   d   RMRVR	&   VP                  VRR
7      R,           pVP                  \        V4      R4      pRp ^ RI
p	^ p
V P                  pV	P                  WWWRR7      pVP                  4        VP                  R9   d{   VP                  P!                  R4      '       dZ   VP                  R,          pV	P                  VVVVRR7      pVP                  4        V
^,          p
V
^8  g   K}  ^RIHp V! R4      h\&        P)                  RT;'       d    VP                  4        V'       d&   VP.                  '       d   V P1                  R4       R# V P1                  R4       V'       d5   VP                  '       d!   V P1                  RVP                   24       R# R# R#   \*         d!   p\&        P-                  RT4        Rp?LRp?ii ; i  \*         d"   p\&        P)                  RT4        Rp?R# Rp?ii ; i)rL   N)rv   z
User-Agentc              3  >   "   T F  p\        V4      ^8  x  K  	  R# 5i)   N)ord)r   cs   & r   r   3ExceptionHandler._execute_upload.<locals>.<genexpr>_  s     7hAhs   FTis_asciir   
has_spaces)	sort_keysr1   USERNAME_REMOVED)headersr   dataallow_redirectsLocation)rN   zRedirect limit exceededzupload response status: %sr   zUpload successful.zUpload did not complete.z HTTP )i-  i.  )getpasscommon.serializerv   rB   r?   getuserallr+   dumpsreplacerequestsrE   postraise_for_statusstatus_coder   getr   rN   rW   rX   r   infookr5   )r!   rq   r   rv   r   _timeoutusernamer   responser   redirect_counterurlrN   r   s   &&            r   r    ExceptionHandler._execute_uploadP  s:   
 	* $//
 $$??$C7h7CCC7h777DU 	Z  .1CM-ATu\"zz,$z7$>||CM+=>	  ''C}}hSX % H %%'&&*49I9I9M9M: : &&z2#==#$$) )  ))+ A% #b(,$%>??II2H4U4UAUAUV	HKKK349: 4 4 4NNVH,@,@+A#BC !58  	HHT1	  	IIdA	sb   A'H- -AH- 8&H- H- 1I 9I I I 7I 	I -I8IIJ&JJc                    V ^8  d   QhRRRR/# )r   r   r   r   r,   r   )r   s   "r   r   r     s      d t r   c           	     	    VR J d   V P                  RRRRRRR4       R# Vf   V P                  RRR4       R# V P                  RRRR	R4       R# )
Tr   z'Thank you for helping to improve conda.zAOpt-in to always sending reports (and not see this message again)z
by runningz+    $ conda config --set report_errors trueNz Timeout reached. No report sent.z+No report sent. To permanently opt-out, usez,    $ conda config --set report_errors false)r5   )r!   r   s   &&r   r   ExceptionHandler._post_upload  sg    
 NN9S= NN2 NN=>r   r   N)r   
__module____qualname____firstlineno__r'   r5   propertyr?   rB   r	   rE   r    r\   r`   rc   r[   ro   rp   ry   r   r   r   r   r   r   __static_attributes__r   r   r   r   r      s   :# U U
 " "
 (	 
(
!AF#/+	#%N2-h*-X   )	)@ 	( 9	9v 	r   r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r     s      "2  r   c                2    \        4       pV! V .VO5/ VB pV# r   )r   )r   r"   r#   exception_handlerreturn_values   &*,  r   conda_exception_handlerr     s%    (*$T;D;F;Lr   )__doc__
__future__r   r   r   	functoolsr   r   loggingr   typingr   common.compatr   r   deprecationsr	   collections.abcr
   typesr   r   r   r   r   rW   r   r   r   r   r   <module>r     sS    * " 	 
 .    3 $(##AT Tnr   