ó
    Ñ]j+"  ã                   óÜ   • S r SSKrSSKrSSKJr  SSKJr  SSKrSSK	J
r
  SSKJr  SSKJr  SSKJr  SS	KJr  SS
KJrJr  SSKrSrSr " S S5      rS\\   S\S\R8                  SS4S jrg)ztsys.excepthook for IPython itself, leaves a detailed report on disk.

Authors:

* Fernando Perez
* Brian E. Granger
é    N)Úpformat)ÚPath)Úultratb)ÚApplication)Úauthor_email)Úsys_info)Ú__version__)ÚOptionalÚDicta†  Oops, {app_name} crashed. We do our best to make it stable, but...

A crash report was automatically generated with the following information:
  - A verbatim copy of the crash traceback.
  - A copy of your input history during this session.
  - Data on your current {app_name} configuration.

It was left in the file named:
	'{crash_report_fname}'
If you can email this file to the developers, the information in it will help
them in understanding and correcting the problem.

You can mail it to: {contact_name} at {contact_email}
with the subject '{app_name} Crash Report'.

If you want to do it now, the following command will work (under Unix):
mail -s '{app_name} Crash Report' {contact_email} < {crash_report_fname}

In your email, please also include information about:
- The operating system under which the crash happened: Linux, macOS, Windows,
  other, and which exact version (for example: Ubuntu 16.04.3, macOS 10.13.2,
  Windows 10 Pro), and whether it is 32-bit or 64-bit;
- How {app_name} was installed: using pip or conda, from GitHub, as part of
  a Docker container, or other, providing more detail if possible;
- How to reproduce the crash: what exact sequence of instructions can one
  input to get the same crash? Ideally, find a minimal yet complete sequence
  of instructions that yields the crash.

To ensure accurate tracking of this issue, please file a report about it at:
{bug_tracker}
a„  
If you suspect this is an IPython {version} bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at {email}

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    {config}Application.verbose_crash=True
c                   óÄ   • \ rS rSr% Sr\rSr\\	\
\	   4   \S'        SS\S\
\	   S\
\	   S	\
\	   S
\S\4S jjrS\\   S\S\R$                  SS4S jrS\	S\	4S jrSrg)ÚCrashHandleréY   zíCustomizable crash handlers for IPython applications.

Instances of this class provide a :meth:`__call__` method which can be
used as a ``sys.excepthook``.  The :meth:`__call__` signature is::

    def __call__(self, etype, evalue, etb)
zO

***************************************************************************

ÚinfoNÚappÚcontact_nameÚcontact_emailÚbug_trackerÚshow_crash_tracebackÚcall_pdbc                 óœ   • SUR                   -  U l        Xl        X`l        XPl        [        UR                   UUUU R                  S9U l        g)aò  Create a new crash handler

Parameters
----------
app : Application
    A running :class:`Application` instance, which will be queried at
    crash time for internal information.
contact_name : str
    A string with the name of the person to contact.
contact_email : str
    A string with the email address of the contact.
bug_tracker : str
    A string with the URL for your project's bug tracker.
show_crash_traceback : bool
    If false, don't print the crash traceback on stderr, only generate
    the on-disk report
call_pdb
    Whether to call pdb on crash

Attributes
----------
These instances contain some non-argument attributes which allow for
further customization of the crash handler's behavior. Please see the
source for further details.

zCrash_report_%s.txt)Úapp_namer   r   r   Úcrash_report_fnameN)Únamer   r   r   r   Údictr   )Úselfr   r   r   r   r   r   s          ÚV/home/mande/repo/quber/.venv/lib/python3.13/site-packages/IPython/core/crashhandler.pyÚ__init__ÚCrashHandler.__init__f   sK   € ðF #8¸#¿(¹(Ñ"BˆÔØŒØ Œà$8Ô!Ü C§H¡HØ#/Ø$1Ø"-Ø)-×)@Ñ)@ñ	Bˆ�	ó    ÚetypeÚevalueÚetbÚreturnc                 ó8  • [         R                  [         l        [        U R                  SS5      nUb#  [        U[        5      (       d   e[        U5      nO[        R                  " 5       nUR                  5       (       d  [        R                  " 5       nXPR                  -  n[        U5      U l
        [        U5      U R                  S'   [        R                  " SSU R                  S9nU R                  (       a
  U" XU5        gUR                  XUSS9nU R                   (       a  [#        U[         R$                  S	9   ['        US
SS9n	U	   [#        S[         R$                  S	9  [#        U R(                  R*                  " S0 U R                  D6[         R$                  S	9  U	R-                  U R/                  [        U5      5      5        SSS5        [0        R2                  " S5        g!   [#        S[         R$                  S	9   g= f! , (       d  f       ND= f)z<Handle an exception, call for compatible with sys.excepthookÚipython_dirNr   ÚnocolorT)Ú
theme_nameÚlong_headerr   é   )Úcontext©ÚfileÚwzutf-8)Úencodingz&Could not create crash report on disk.zH
**********************************************************************
z.Hit <Enter> to quit (your terminal may close):© )ÚsysÚ__excepthook__Ú
excepthookÚgetattrr   Ú
isinstanceÚstrr   ÚcwdÚis_dirr   r   r   Ú	VerboseTBr   Útextr   ÚprintÚstderrÚopenÚmessage_templateÚformatÚwriteÚmake_reportÚbuiltin_modÚinput)
r   r    r!   r"   r%   ÚrptdirÚreport_nameÚ	TBhandlerÚ	tracebackÚreports
             r   Ú__call__ÚCrashHandler.__call__”   s™  € ô ×+Ñ+ŒŒô ˜dŸh™h¨°tÓ<ˆØÑ"Ü˜k¬3×/Ñ/Ð/Ð/Ü˜+Ó&‰Fä—X’X“ZˆFØ�}‰}�‰Ü—X’X“ZˆFØ×6Ñ6Ñ6ˆô #& kÓ"2ˆÔÜ*-¨kÓ*:ˆ�	‰	Ð&Ñ'Ü×%Ò%Ø ØØ—]‘]ñ
ˆ	ð
 �=�=Ù�e 3Ô'Øà!Ÿ™ u°CÀ˜ÐCˆIð ×$×$Ü�)¤#§*¡*Ò-ð	Ü˜+ s°WÑ=ˆFò
 äÐ"¬¯©Ò4Ü�$×'Ñ'×.Ò.Ñ;°·±Ñ;Ä#Ç*Á*ÒMð �L‰L˜×)Ñ)¬#¨i«.Ó9Ô:÷ ô 	×ÒÐJÕKøð	ÜÐ:ÄÇÁÒLÙúç�Vús   ÅG, ÅA>HÇ,HÈ
HrF   c                 óR  • U R                   nS/nUR                  nU" [        5       5         [        U R                  R
                  5      nU" U5        U" SU R                  R                  -  5        U" S5        U" U5        U" US-   U-   5        SR                  U5      $ !    N#= f)z*Return a string containing a crash report.zi***************************************************************************

IPython post-mortem report

zApplication name: %s

z'Current user configuration structure:

zCrash traceback:

Ú )Úsection_sepÚappendr   r   r   Úconfigr   Újoin)r   rF   Úsec_seprG   Úrpt_addrN   s         r   r@   ÚCrashHandler.make_reportÐ   sœ   € ð ×"Ñ"ˆà@ÐAˆØ—-‘-ˆÙ”“
Ôð	Ü˜TŸX™XŸ_™_Ó-ˆFÙ�GÔÙÐ.°·±·±Ñ>Ô?ÙÐ?Ô@Ù�FŒOñ 	�Ð.Ñ.°Ñ:Ô;à�w‰w�v‹Ðøð		Ùús   ­AB" Â"B&)r   r   r   r   r   )NNNTF)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú_default_message_templater=   rL   r   r5   r
   Ú__annotations__r   Úboolr   ÚtypeÚBaseExceptionÚtypesÚTracebackTyperH   r@   Ú__static_attributes__r/   r   r   r   r   Y   sÛ   ‡ ñð 1ÐØ&€KØ
ˆs�H˜S‘MÐ!Ñ
"Ó"ð
 '+Ø'+Ø%)Ø%)Øñ,Bàð,Bð ˜s‘mð,Bð   ‘}ð	,Bð
 ˜c‘]ð,Bð #ð,Bð õ,Bð\:Là�MÑ"ð:Lð ð:Lð × Ñ ð	:Lð
 
ô:Lðx Sð ¨S÷ r   r   r    r!   Útbr#   c                 óØ   • [         R                  " XU5        SSKJn  UR	                  5       (       a  SnOSn[        [        R                  [        U[        S9[        R                  S9  g)zAa light excepthook, adding a small message to the usual tracebackr   )ÚInteractiveShellz%config zc.)ÚemailrN   Úversionr+   N)rF   Úprint_exceptionÚIPython.core.interactiveshellrb   Úinitializedr:   Ú_lite_message_templater>   r   rd   r0   r;   )r    r!   r`   rb   rN   s        r   Úcrash_handler_literi   æ   sW   € ô ×Ò˜e¨RÔ0å>Ø×#Ñ#×%Ñ%à‰ð ˆÜ	Ô
 ×
'Ñ
'¬lÀ6ÔSZÐ
'Ð
[Ôbe×blÑblÓmr   )rW   r0   rF   Úpprintr   Úpathlibr   ÚbuiltinsrA   ÚIPython.corer   ÚIPython.core.applicationr   ÚIPython.core.releaser   ÚIPython.utils.sysinfor   r	   rd   Útypingr
   r   r]   rX   rh   r   r[   r\   r^   ri   r/   r   r   Ú<module>rr      sƒ   ðñó( Û Ý Ý ã å  Ý 0Ý -Ý *å 7ç !Û ðÐ ðB
Ð ÷Jñ JðZnØ�ÑðnØ(5ðnØ;@×;NÑ;Nðnà	õnr   