
    ^h<!                         S r SSK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  SS	K	Jr  SS
KJr  SrSr " S S\5      rS rg)ztsys.excepthook for IPython itself, leaves a detailed report on disk.

Authors:

* Fernando Perez
* Brian E. Granger
    N)pformat)Path)ultratb)author_email)sys_info)input)__version__)Optionala  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                   j    \ rS rSrSr\rSr     SS\\	   S\\	   S\\	   S\
S	\
4
S
 jjrS rS rSrg)CrashHandlerW   zCustomizable 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

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

N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   appr   r   dictinfo)selfr   r   r   r   r   r   s          S/home/james-whalen/.local/lib/python3.13/site-packages/IPython/core/crashhandler.py__init__CrashHandler.__init__c   sK    F #8#(("B $8!CHH#/$1"-)-)@)@	B	    c                    [         R                  [         l        Sn U R                  R                  nUb  [
        R                  " U5      (       d  [
        R                  " 5       nXPR                  -  nX`l        X`R                  S'   [        R                  " U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        SSS5        [-        S5        g!   [
        R                  " 5       n GN{= f!   [        S[         R                   S9   g= f! , (       d  f       NV= f)z<Handle an exception, call for compatible with sys.excepthookNoColorNr      )color_scheme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__
excepthookr   ipython_dirr   cwdis_dirr   r   r   	VerboseTBr   textr   printstderropenmessage_templateformatwritemake_reportr   )
r   etypeevalueetbr"   rptdirreport_name	TBhandler	tracebackreports
             r   __call__CrashHandler.__call__   sv    ++ !	 XX))F >V!4!4XXZF666 #.*5		&'%%%]]
	
 ==e3'!uCCI $$)#**-	+sW=F
 "4$''..;;#**M LL)))45  	>?O	 XXZF4	:LVs$   F >F1 A5GF.1G
Gc                 >   U R                   nS/nUR                  nU" [        5       5         [        U R                  R
                  5      nU" U5        U" SU 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   r@   sec_seprA   rpt_addrH   s         r   r9   CrashHandler.make_report   s     ""@A--
	TXX__-FG.>??@FO 	..:;wwv		s   AB B)r   r   r   r   r   )NNNTF)__name__
__module____qualname____firstlineno____doc___default_message_templater6   rF   r
   strboolr   rB   r9   __static_attributes__r*   r   r   r   r   W   s{     1&K
 '+'+%)%),B sm,B  }	,B
 c],B #,B ,B^6@pr   r   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.)emailrH   versionr&   N)r@   print_exceptionIPython.core.interactiveshellrW   initializedr3   _lite_message_templater7   r   rY   r+   r4   )r:   r;   tbrW   rH   s        r   crash_handler_liter_      sU    eR0>##%% 	
 
'
'l6SZ
'
[beblblmr   )rQ   r+   r@   pprintr   pathlibr   IPython.corer   IPython.core.releaser   IPython.utils.sysinfor   IPython.utils.py3compatr   r	   rY   typingr
   rR   r]   objectr   r_   r*   r   r   <module>rh      sP   (       - * ) 7  B
 F6 FRnr   