o
    ,º]`  ã                   @   s¾  d Z ddlmZ ddlmZ ddlmZ ddlmZ G dd„ deƒZG dd	„ d	eƒZ	G d
d„ de	ƒZ
G dd„ de	ƒZG dd„ deeƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZeZG d d!„ d!eƒZG d"d#„ d#eƒZG d$d%„ d%eƒZG d&d'„ d'eƒZG d(d)„ d)eƒZG d*d+„ d+eƒZG d,d-„ d-eƒZG d.d/„ d/eƒZG d0d1„ d1eƒZ G d2d3„ d3eƒZ!G d4d5„ d5eƒZ"d6S )7z email package exception classes.é    )Úunicode_literals)Údivision)Úabsolute_import)Úsuperc                   @   ó   e Zd ZdZdS )ÚMessageErrorz+Base class for errors in the email package.N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r   r   ú?/usr/lib/python3/dist-packages/future/backports/email/errors.pyr      ó    r   c                   @   r   )ÚMessageParseErrorz&Base class for message parsing errors.Nr   r   r   r   r   r      r   r   c                   @   r   )ÚHeaderParseErrorzError while parsing headers.Nr   r   r   r   r   r      r   r   c                   @   r   )ÚBoundaryErrorz#Couldn't find terminating boundary.Nr   r   r   r   r   r      r   r   c                   @   r   )ÚMultipartConversionErrorz(Conversion to a multipart is prohibited.Nr   r   r   r   r   r      r   r   c                   @   r   )ÚCharsetErrorzAn illegal charset was given.Nr   r   r   r   r   r       r   r   c                       s"   e Zd ZdZd‡ fdd„	Z‡  ZS )ÚMessageDefectz Base class for a message defect.Nc                    s   |d ur
t ƒ  |¡ || _d S ©N)r   Ú__init__Úline)Úselfr   ©Ú	__class__r   r   r   (   s   
zMessageDefect.__init__r   ©r	   r
   r   r   r   Ú__classcell__r   r   r   r   r   %   s    r   c                   @   r   )ÚNoBoundaryInMultipartDefectzBA message claimed to be a multipart but had no boundary parameter.Nr   r   r   r   r   r   -   r   r   c                   @   r   )ÚStartBoundaryNotFoundDefectz+The claimed start boundary was never found.Nr   r   r   r   r   r   0   r   r   c                   @   r   )ÚCloseBoundaryNotFoundDefectzEA start boundary was found, but not the corresponding close boundary.Nr   r   r   r   r   r    3   r   r    c                   @   r   )Ú#FirstHeaderLineIsContinuationDefectz;A message had a continuation line as its first header line.Nr   r   r   r   r   r!   6   r   r!   c                   @   r   )ÚMisplacedEnvelopeHeaderDefectz?A 'Unix-from' header was found in the middle of a header block.Nr   r   r   r   r   r"   9   r   r"   c                   @   r   )Ú MissingHeaderBodySeparatorDefectzEFound line with no leading whitespace and no colon before blank line.Nr   r   r   r   r   r#   <   r   r#   c                   @   r   )Ú!MultipartInvariantViolationDefectz?A message claimed to be a multipart but no subparts were found.Nr   r   r   r   r   r$   A   r   r$   c                   @   r   )Ú-InvalidMultipartContentTransferEncodingDefectzEAn invalid content transfer encoding was set on the multipart itself.Nr   r   r   r   r   r%   D   r   r%   c                   @   r   )ÚUndecodableBytesDefectz0Header contained bytes that could not be decodedNr   r   r   r   r   r&   G   r   r&   c                   @   r   )ÚInvalidBase64PaddingDefectz/base64 encoded sequence had an incorrect lengthNr   r   r   r   r   r'   J   r   r'   c                   @   r   )ÚInvalidBase64CharactersDefectz=base64 encoded sequence had characters not in base64 alphabetNr   r   r   r   r   r(   M   r   r(   c                       s    e Zd ZdZ‡ fdd„Z‡  ZS )ÚHeaderDefectzBase class for a header defect.c                    s   t ƒ j|i |¤Ž d S r   )r   r   )r   ÚargsÚkwr   r   r   r   U   s   zHeaderDefect.__init__r   r   r   r   r   r)   R   s    r)   c                   @   r   )ÚInvalidHeaderDefectz+Header is not valid, message gives details.Nr   r   r   r   r   r,   X   r   r,   c                   @   r   )ÚHeaderMissingRequiredValuez(A header that must have a value had noneNr   r   r   r   r   r-   [   r   r-   c                       s(   e Zd ZdZ‡ fdd„Zdd„ Z‡  ZS )ÚNonPrintableDefectz8ASCII characters outside the ascii-printable range foundc                    s   t ƒ  |¡ || _d S r   )r   r   Únon_printables)r   r/   r   r   r   r   a   s   
zNonPrintableDefect.__init__c                 C   s   d  | j¡S )Nz6the following ASCII non-printables found in header: {})Úformatr/   )r   r   r   r   Ú__str__e   s   ÿzNonPrintableDefect.__str__)r	   r
   r   r   r   r1   r   r   r   r   r   r.   ^   s    r.   c                   @   r   )ÚObsoleteHeaderDefectz0Header uses syntax declared obsolete by RFC 5322Nr   r   r   r   r   r2   i   r   r2   c                   @   r   )ÚNonASCIILocalPartDefectz(local_part contains non-ASCII charactersNr   r   r   r   r   r3   l   r   r3   N)#r   Ú
__future__r   r   r   Úfuture.builtinsr   Ú	Exceptionr   r   r   r   Ú	TypeErrorr   r   Ú
ValueErrorr   r   r   r    r!   r"   r#   ÚMalformedHeaderDefectr$   r%   r&   r'   r(   r)   r,   r-   r.   r2   r3   r   r   r   r   Ú<module>   s<   