Server IP : 192.158.238.246 / Your IP : 18.216.137.32 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python37/lib/python3.7/site-packages/paste/__pycache__/ |
Upload File : |
B a�N� � @ sb d Z ddlZddlmZ ddlZddlmZ G dd� de�ZG dd� de�Z edd d fdd�Z dS ) z� WSGI middleware Captures any exceptions and prints a pretty report. See the `cgitb documentation <http://python.org/doc/current/lib/module-cgitb.html>`_ for more. � N)�StringIO)� convertersc @ s e Zd ZdS )� NoDefaultN)�__name__� __module__�__qualname__� r r �D/opt/alt/python37/lib/python3.7/site-packages/paste/cgitb_catcher.pyr s r c @ s8 e Zd Zdedddfdd�Zdd� Zdd � Zd d� ZdS )�CgitbMiddlewareN� �htmlc C sX || _ |d kri }|tkr$|�d�}t|t�r8t�|�}|| _|| _t |�| _ || _d S )N�debug)�appr �get� isinstance� basestringr �asbool�display�logdir�int�context�format)�selfr �global_confr r r r r r r �__init__ s zCgitbMiddleware.__init__c C sL y| � ||�}| �||�S t�� }|ddg|� | �||�}|gS d S )Nz500 Internal Server Error)zcontent-typez text/html)r � catching_iter�sys�exc_info�exception_handler)r �environZstart_response�app_iterr �responser r r �__call__) s zCgitbMiddleware.__call__c c s� |st �d}y.x|D ] }|V qW t|d�r8d}|�� W nf | �t�� |�}|s�t|d�r�y|�� W n( | �t�� |�}|d| 7 }Y nX |V Y nX d S )NF�closeTz$<hr noshade>Error in .close():<br>%s)� StopIteration�hasattrr# r r r )r r r Zerror_on_close�vr! Zclose_responser r r r 5 s* zCgitbMiddleware.catching_iterc C s2 t � }tj|| j| j| j| jd�}||� |�� S )N)�filer r r r )r �cgitbZHookr r r r �getvalue)r r r Z dummy_file�hookr r r r L s z!CgitbMiddleware.exception_handler)r r r r r r"