403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/docutils/utils/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/docutils/utils/__pycache__/error_reporting.cpython-39.pyc
a

OԼa�!�
@sdZddlZddlZzddlZWney6dZYn�0ze��dpPe��dZWnFey�Z	z de	j
vrtdZndZWYdZ	[	ndZ	[	0dZYn0ze�ep�d�Wney�dZYn0ej
dkr�eZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�ZdS)u�
Provisional module to handle Exceptions across Python versions.

This module will be deprecated with the end of support for Python 2.7
and be removed in Docutils 1.2.

Error reporting should be safe from encoding/decoding errors.
However, implicit conversions of strings and exceptions like

>>> u'%s world: %s' % ('Hällo', Exception(u'Hällo')

fail in some Python versions:

* In Python <= 2.6, ``unicode(<exception instance>)`` uses
  `__str__` and fails with non-ASCII chars in`unicode` arguments.
  (work around http://bugs.python.org/issue2517):

* In Python 2, unicode(<exception instance>) fails, with non-ASCII
  chars in arguments. (Use case: in some locales, the errstr
  argument of IOError contains non-ASCII chars.)

* In Python 2, str(<exception instance>) fails, with non-ASCII chars
  in `unicode` arguments.

The `SafeString`, `ErrorString` and `ErrorOutput` classes handle
common exceptions.
�N�zunknown locale: UTF-8zUTF-8���rc@s*eZdZdZddd�Zdd�Zd	d
�ZdS)�
SafeStringzG
    A wrapper providing robust conversion to `str` and `unicode`.
    N�backslashreplace�replacecCs0||_|pt|dd�ptpd|_||_||_dS)N�encoding�ascii)�data�getattr�locale_encodingr	�encoding_errors�decoding_errors)�selfrr	rr�r�B/usr/lib/python3.9/site-packages/docutils/utils/error_reporting.py�__init__Rs��zSafeString.__init__cs�zt�j�WSty�t�jt�rJ�fdd��jjD�}d�|�YSt�jt�r�tj	dkrj�jYS�j�
�j�j�YS�Yn0dS)Ncs g|]}tt|�j�j���qSr)�strrr	r��.0�arg�rrr�
<listcomp>`s�
�z&SafeString.__str__.<locals>.<listcomp>�, r)
rr�UnicodeEncodeError�
isinstance�	Exception�args�join�unicode�sys�version_info�encoder	r)rrrrr�__str__[s
�


�zSafeString.__str__c
s�z(t�j�}t�jt�r$|�dd�}|WSty�}z�t�jt�r�d�jjt�jj�j	�j
�t�jj�j	�j
�fWYd}~St�jt�r��fdd��jj
D�}d�|�WYd}~St|t�r�t�j�j	�j
�WYd}~S�WYd}~n
d}~00dS)af
        Return unicode representation of `self.data`.

        Try ``unicode(self.data)``, catch `UnicodeError` and

        * if `self.data` is an Exception instance, work around
          http://bugs.python.org/issue2517 with an emulation of
          Exception.__unicode__,

        * else decode with `self.encoding` and `self.decoding_errors`.
        z: u'z: 'z[Errno %s] %s: '%s'Ncs"g|]}tt|�j�jd���qS))r)r rr	rrrrrr�s�
�z*SafeString.__unicode__.<locals>.<listcomp>r)r rr�EnvironmentErrorr�UnicodeError�errnor�strerrorr	r�filenamerrr�UnicodeDecodeError)r�u�errorrrrr�__unicode__ls.
���
�
zSafeString.__unicode__)Nrr)�__name__�
__module__�__qualname__�__doc__rr$r-rrrrrMs�
	rcs,eZdZdZ�fdd�Z�fdd�Z�ZS)�ErrorStringz3
    Safely report exception type and message.
    csd|jjjtt|���fS�Nz%s: %s)r�	__class__r.�superr2r$r�r4rrr$�s
�zErrorString.__str__csd|jjjtt|���fSr3)rr4r.r5r2r-rr6rrr-�s
�zErrorString.__unicode__)r.r/r0r1r$r-�
__classcell__rrr6rr2�sr2c@s*eZdZdZddd�Zdd�Zd	d
�ZdS)�ErrorOutputz�
    Wrapper class for file-like error streams with
    failsafe de- and encoding of `str`, `bytes`, `unicode` and
    `Exception` instances.
    NrrcCs~|durtj}n>|sd}n4t|t�r0t|d�}nt|t�rNt|�t���d�}||_|pjt	|dd�pjt
pjd|_||_||_
dS)a�
        :Parameters:
            - `stream`: a file-like object,
                        a string (path to a file),
                        `None` (write to `sys.stderr`, default), or
                        evaluating to `False` (write() requests are ignored).
            - `encoding`: `stream` text encoding. Guessed if None.
            - `encoding_errors`: how to treat encoding errors.
        NF�wr	r
)r!�stderrrr�openr r#�getfilesystemencoding�streamrr
r	rr)rr=r	rrrrrr�s"

��zErrorOutput.__init__c	Cs�|jdurdSt|t�r0tt||j|j|j��}z|j�|�Wn�t	yj|j�|�
|j|j��Yntty�t|t�r�|j�|�
|j|j��YdS|jtj
tjfvr�|jj�|�n|j�t||j|j��Yn0dS)z�
        Write `data` to self.stream. Ignore, if self.stream is False.

        `data` can be a `string`, `unicode`, or `Exception` instance.
        FN)r=rrr rr	rr�writerr#�	TypeErrorr!r:�stdout�buffer)rrrrrr>�s*


�
��zErrorOutput.writecCs<|jtjtjfvrdSz|j��Wnty6Yn0dS)z�
        Close the error-output stream.

        Ignored if the stream is` sys.stderr` or `sys.stdout` or has no
        close() method.
        N)r=r!r@r:�close�AttributeErrorrrrrrB�szErrorOutput.close)NNrr)r.r/r0r1rr>rBrrrrr8�s�
#r8)r1�codecsr!�locale�ImportErrorr
�	getlocale�getdefaultlocale�
ValueErrorr,r�lookup�LookupErrorr"rr �objectrr2r8rrrr�<module>s.




@

Youez - 2016 - github.com/yon3zu
LinuXploit