/usr/lib/python3.10/email/__pycache__
NameSizeModeActions
base64mime.cpython-310.pyc32400644editdlrm
charset.cpython-310.pyc115750644editdlrm
contentmanager.cpython-310.pyc73890644editdlrm
encoders.cpython-310.pyc16270644editdlrm
errors.cpython-310.pyc58500644editdlrm
feedparser.cpython-310.pyc105780644editdlrm
generator.cpython-310.pyc132000644editdlrm
header.cpython-310.pyc164620644editdlrm
headerregistry.cpython-310.pyc219050644editdlrm
iterators.cpython-310.pyc19680644editdlrm
message.cpython-310.pyc378040644editdlrm
parser.cpython-310.pyc56730644editdlrm
policy.cpython-310.pyc96530644editdlrm
quoprimime.cpython-310.pyc76230644editdlrm
utils.cpython-310.pyc118660644editdlrm
_encoded_words.cpython-310.pyc57400644editdlrm
_header_value_parser.cpython-310.pyc784540644editdlrm
_parseaddr.cpython-310.pyc125120644editdlrm
_policybase.cpython-310.pyc152400644editdlrm
__init__.cpython-310.pyc15600644editdlrm
Edit: /usr/lib/python3.10/email/__pycache__/_encoded_words.cpython-310.pyc (5740B)
o 9j]!@sdZddlZddlZddlZddlZddlmZmZddlm Z gdZ e e dj ddZd d ZGd d d eZeZd eed<ddZddZddZddZddZeedZddZeedZeedZd ddZdS)!z Routines for manipulating RFC2047 encoded words. This is currently a package-private API, but will be considered for promotion to a public API if there is demand. N) ascii_lettersdigits)errors)decode_qencode_qdecode_bencode_blen_qlen_bdecodeencodes=([a-fA-F0-9]{2})cCst|dS)N)bytesfromhexgroupr )mr+/usr/lib/python3.10/email/_encoded_words.pyAsrcCs|dd}t|gfS)N_ )replace_q_byte_subber)encodedrrrrCs  rc@s,eZdZdededZddZdS) _QByteMaps-!*+/asciicCs4||jvrt|||<||Sd|||<||S)Nz={:02X})safechrformat)selfkeyrrr __missing__Ms  z_QByteMap.__missing__N)__name__ __module__ __qualname__rr rrr!rrrrrIs r_ cCsddd|DS)Ncss|]}t|VqdSN) _q_byte_map.0xrrr Zszencode_q..)joinbstringrrrrYsrcCstdd|DS)Ncss|] }tt|VqdSr()lenr)r*rrrr-]szlen_q..)sumr/rrrr \sr cCst|d}|rddd|nd}ztj||dd|r$tgfWSgfWStjysztj|ddtgfWYStjyrztj|dddttgfWYYStjyq|tgfYYYSwww)Ns===T)validateFs==) r1base64 b64decoderInvalidBase64PaddingDefectbinasciiErrorInvalidBase64CharactersDefectInvalidBase64LengthDefect)rpad_errmissing_paddingrrrrds2    rcCst|dS)Nr)r6 b64encoder r/rrrrsrcCs(tt|d\}}|d|rdSdS)Nr3r)divmodr1)r0 groups_of_3leftoverrrrr sr )qbc Cs|d\}}}}}|d\}}}|}|dd}t||\}}z||}Wn=tyF|t d|d||d}Yn#t t fyh|dd}|dkrf|t d|d Ynw||||fS) aDecode encoded word and return (string, charset, lang, defects) tuple. An RFC 2047/2243 encoded word has the form: =?charset*lang?cte?encoded_string?= where '*lang' may be omitted but the other parts may not be. This function expects exactly such a string (that is, it does not check the syntax and may raise errors if the string is not well formed), and returns the encoded_string decoded first from its Content Transfer Encoding and then from the resulting bytes into unicode using the specified charset. If the cte-decoded string does not successfully decode using the specified character set, a defect is added to the defects list and the unknown octets are replaced by the unicode 'unknown' character \uFDFF. The specified charset and language are returned. The default for language, which is rarely if ever encountered, is the empty string. ?*rsurrogateescapez0Encoded word contains bytes not decodable using z charset unknown-8bitzUnknown charset z* in encoded word; decoded as unknown bytes) split partitionlowerr _cte_decodersr UnicodeDecodeErrorappendrUndecodableBytesDefect LookupErrorUnicodeEncodeError CharsetError) ewr%charsetcte cte_stringlangr0defectsstringrrrr s&       r utf-8r'cCs||dkr |dd}n||}|dur*td|}td|}||dkr(dnd}t||}|r6d|}d ||||S) aEncode string using the CTE encoding that produces the shorter result. Produces an RFC 2047/2243 encoded word of the form: =?charset*lang?cte?encoded_string?= where '*lang' is omitted unless the 'lang' parameter is given a value. Optional argument charset (defaults to utf-8) specifies the charset to use to encode the string to binary before CTE encoding it. Optional argument 'encoding' is the cte specifier for the encoding that should be used ('q' or 'b'); if it is None (the default) the encoding which produces the shortest encoded sequence is used, except that 'q' is preferred if it is up to five characters longer. Optional argument 'lang' (default '') gives the RFC 2243 language string to specify in the encoded word. rIrrHNrDrErGz=?{}{}?{}?{}?=)r _cte_encode_length _cte_encodersr)rZrUencodingrXr0qlenblenrrrrr s    r )r[Nr')__doc__rer6r9 functoolsrZrremailr__all__partialcompilesubrrdictrr)ordrr rrr rMr r^r]r rrrrs>)  &+