online +ˆÆÑ „ �2/пÎ?÷+a ´i&^ã@sèdZgd¢ZddlZddlZddlZddlZddlmZddlm Z e j Z dZ dZ dZd Zd Zd Zd Ze d ƒZe dƒZe dejejB¡Ze d¡Ze d¡ZejjZdd„Zddd„ZGdd„dƒZGdd„dƒZ Gdd„de!ƒZ"dS)z+Header encoding and decoding functionality.)ÚHeaderÚ decode_headerÚ make_headeréN)ÚHeaderParseError)ÚcharsetÚ ú ó z ÚéNz úus-asciizutf-8ai =\? # literal =? (?P[^?]*?) # non-greedy up to the next ? is the charset \? # literal ? (?P[qQbB]) # either a "q" or a "b", case insensitive \? # literal ? (?P.*?) # non-greedy up to the next ?= is the encoded string \?= # literal ?= z[\041-\176]+:$z \n[^ \t]+:c Cs–t|dƒrdd„|jDƒSt |¡s.|dfgSg}| ¡D]€}t |¡}d}|r:| d¡}|rj| ¡}d}|r~| |ddf¡|rL| d¡  ¡}| d¡  ¡}| d¡}| |||f¡qLq:g} t |ƒD]J\} } | dkrÈ| drÈ|| d drÈ|| dd  ¡rÈ|  | d¡qÈt | ƒD] } || =�qg} |D]È\}}}|du�rV|  ||f¡n¢|d k�r|t j |¡}|  ||f¡n||d k�rìt|ƒd }|�r¬|d dd |…7}zt j |¡}Wntj�yÚtdƒ‚Yn0|  ||f¡n td|ƒ‚�q2g}d}}| D]v\}}t|tƒ�r*t|dƒ}|du�r>|}|}nB||k�r`| ||f¡|}|}n |du�rx|t|7}n||7}�q | ||f¡|S)a;Decode a message header value without converting charset. Returns a list of (string, charset) pairs containing each of the decoded parts of the header. Charset is None for non-encoded parts of the header, otherwise a lower-case string containing the name of the character set specified in the encoded string. header may be a string that may or may not contain RFC2047 encoded words, or it may be a Header object. An email.errors.HeaderParseError may be raised when certain decoding error occurs (e.g. a base64 decoding exception). Ú_chunkscSs(g|] \}}t |t|ƒ¡t|ƒf‘qS©)Ú_charsetZ_encodeÚstr)Ú.0Ústringrrrú$/usr/lib64/python3.9/email/header.pyÚ Msÿz!decode_header..NTrFééÚqÚbéz===zBase64 decoding errorzUnexpected encoding: zraw-unicode-escape)Úhasattrr ÚecreÚsearchÚ splitlinesÚsplitÚpopÚlstripÚappendÚlowerÚ enumerateÚisspaceÚreversedÚemailÚ quoprimimeZ header_decodeÚlenZ base64mimeÚdecodeÚbinasciiÚErrorrÚAssertionErrorÚ isinstancerÚbytesÚBSPACE)ÚheaderÚwordsÚlineÚpartsÚfirstZ unencodedrÚencodingÚencodedZdroplistÚnÚwÚdZ decoded_wordsZencoded_stringZwordZpaderrZ collapsedZ last_wordÚ last_charsetrrrr=s| ÿ      4              rcCsFt|||d�}|D].\}}|dur4t|tƒs4t|ƒ}| ||¡q|S)a¼Create a Header from a sequence of pairs as returned by decode_header() decode_header() takes a header value string and returns a sequence of pairs of the format (decoded_string, charset) where charset is the string name of the character set. This function takes one of those sequence of pairs and returns a Header instance. Optional maxlinelen, header_name, and continuation_ws are as in the Header constructor. )Ú maxlinelenÚ header_nameÚcontinuation_wsN)rr-ÚCharsetr!)Z decoded_seqr;r<r=ÚhÚsrrrrrœs ÿ rc@sJeZdZddd„Zdd„Zdd „Zdd d „Zd d „Zddd„Zdd„Z dS)rNrÚstrictcCs||durt}nt|tƒs t|ƒ}||_||_g|_|durH| |||¡|durTt}||_|durjd|_ nt |ƒd|_ dS)aDCreate a MIME-compliant header that can conta