/usr/lib64/python3.9/email/__pycache__
NameSizeModeActions
base64mime.cpython-39.opt-1.pyc32390644editdlrm
base64mime.cpython-39.opt-2.pyc14620644editdlrm
base64mime.cpython-39.pyc32390644editdlrm
charset.cpython-39.opt-1.pyc114320644editdlrm
charset.cpython-39.opt-2.pyc51030644editdlrm
charset.cpython-39.pyc114530644editdlrm
contentmanager.cpython-39.opt-1.pyc73600644editdlrm
contentmanager.cpython-39.opt-2.pyc73600644editdlrm
contentmanager.cpython-39.pyc73600644editdlrm
encoders.cpython-39.opt-1.pyc16220644editdlrm
encoders.cpython-39.opt-2.pyc12710644editdlrm
encoders.cpython-39.pyc16220644editdlrm
errors.cpython-39.opt-1.pyc60770644editdlrm
errors.cpython-39.opt-2.pyc46110644editdlrm
errors.cpython-39.pyc60770644editdlrm
feedparser.cpython-39.opt-1.pyc104880644editdlrm
feedparser.cpython-39.opt-2.pyc88250644editdlrm
feedparser.cpython-39.pyc106090644editdlrm
generator.cpython-39.opt-1.pyc131840644editdlrm
generator.cpython-39.opt-2.pyc94850644editdlrm
generator.cpython-39.pyc131840644editdlrm
header.cpython-39.opt-1.pyc164320644editdlrm
header.cpython-39.opt-2.pyc108080644editdlrm
header.cpython-39.pyc164320644editdlrm
headerregistry.cpython-39.opt-1.pyc219300644editdlrm
headerregistry.cpython-39.opt-2.pyc161670644editdlrm
headerregistry.cpython-39.pyc219660644editdlrm
iterators.cpython-39.opt-1.pyc19310644editdlrm
iterators.cpython-39.opt-2.pyc13110644editdlrm
iterators.cpython-39.pyc19310644editdlrm
message.cpython-39.opt-1.pyc379070644editdlrm
message.cpython-39.opt-2.pyc213490644editdlrm
message.cpython-39.pyc379070644editdlrm
parser.cpython-39.opt-1.pyc57460644editdlrm
parser.cpython-39.opt-2.pyc27280644editdlrm
parser.cpython-39.pyc57460644editdlrm
policy.cpython-39.opt-1.pyc96390644editdlrm
policy.cpython-39.opt-2.pyc34240644editdlrm
policy.cpython-39.pyc96390644editdlrm
quoprimime.cpython-39.opt-1.pyc76740644editdlrm
quoprimime.cpython-39.opt-2.pyc41990644editdlrm
quoprimime.cpython-39.pyc76740644editdlrm
utils.cpython-39.opt-1.pyc127350644editdlrm
utils.cpython-39.opt-2.pyc89620644editdlrm
utils.cpython-39.pyc127350644editdlrm
_encoded_words.cpython-39.opt-1.pyc57070644editdlrm
_encoded_words.cpython-39.opt-2.pyc38210644editdlrm
_encoded_words.cpython-39.pyc57070644editdlrm
_header_value_parser.cpython-39.opt-1.pyc803130644editdlrm
_header_value_parser.cpython-39.opt-2.pyc633810644editdlrm
_header_value_parser.cpython-39.pyc803450644editdlrm
_parseaddr.cpython-39.opt-1.pyc123930644editdlrm
_parseaddr.cpython-39.opt-2.pyc94330644editdlrm
_parseaddr.cpython-39.pyc123930644editdlrm
_policybase.cpython-39.opt-1.pyc152660644editdlrm
_policybase.cpython-39.opt-2.pyc60130644editdlrm
_policybase.cpython-39.pyc152660644editdlrm
__init__.cpython-39.opt-1.pyc16670644editdlrm
__init__.cpython-39.opt-2.pyc10420644editdlrm
__init__.cpython-39.pyc16670644editdlrm
Edit: /usr/lib64/python3.9/email/__pycache__/utils.cpython-39.pyc (12735B)
a à”|jYHã@s dZgd¢ZddlZddlZddlZddlZddlZddlZddlZ ddl m Z ddl m Z ddl mZddl mZmZmZddlmZd Zd Zd Zd Zd Ze d ¡Ze d¡ZdZdadd„Zdd„Zdd„Z dd„Z!dFdd„Z"dd„Z#dd„Z$dZ%dd œd!d"„Z&d#d$„Z'd%d&„Z(d'd(„Z)d)d*„Z*dGd,d-„Z+dHd.d/„Z,dId0d1„Z-d2d3„Z.dd œd4d5„Z/d6d7„Z0d8d9„Z1dJd:d;„Z2e d„Z5dKdAdB„Z6dLdDdE„Z7dS)MzMiscellaneous utilities.)Úcollapse_rfc2231_valueÚ decode_paramsÚdecode_rfc2231Úencode_rfc2231Ú formataddrÚ formatdateÚformat_datetimeÚ getaddressesÚ make_msgidÚ mktime_tzÚ parseaddrÚ parsedateÚ parsedate_tzÚparsedate_to_datetimeÚunquoteéN)Úquote)Ú AddressList)r )r r Ú _parsedate_tz)ÚCharsetz, Úz ú'z[][\\()<>@,:;".]z[\\"]z/etc/python/email.cfgcCstdurtƒatS)z5"Cache implementation for _cached_strict_addr_parsingN)Ú_cached_strict_addr_parsingÚ_use_strict_email_parsing_impl©rrú#/usr/lib64/python3.9/email/utils.pyÚ_use_strict_email_parsing7srcCs˜ttj d¡ƒ}|rdSz ttƒ}Wnty6YnV0|�@ddl}|jddd�}|  |¡|j dddd�}Wdƒn1s‚0Y|r”dSd S) z]Returns True if strict email parsing is not disabled by config file or env variable. Z(PYTHON_EMAIL_DISABLE_STRICT_ADDR_PARSINGFrN)ú#)Z interpolationZcomment_prefixesZemail_addr_parsing)ÚfallbackT) ÚboolÚosÚenvironÚgetÚopenÚ_EMAIL_CONFIG_FILEÚFileNotFoundErrorÚ configparserÚ ConfigParserZ read_fileZ getboolean)ÚdisabledÚfiler%Zconfigrrrr?s$  þ .rcCs(z| ¡WdSty"YdS0dS)z8Return True if s contains surrogate-escaped binary data.FTN)ÚencodeÚUnicodeEncodeError)ÚsrrrÚ_has_surrogates\s  r,cCs| dd¡}| dd¡S)Núutf-8ÚsurrogateescapeÚreplace)r)Údecode)ÚstringZoriginal_bytesrrrÚ _sanitizeis r2r-cCs’|\}}| d¡|rŽz| d¡Wn:ty^t|tƒrDt|ƒ}| |¡}d||fYS0d}t |¡rrd}t  d|¡}d||||fS|S)aúThe inverse of parseaddr(), this takes a 2-tuple of the form (realname, email_address) and returns the string value suitable for an RFC 2822 From, To or Cc header. If the first element of pair is false, then the second element is returned unmodified. The optional charset is the character set that is used to encode realname in case realname is not ASCII safe. Can be an instance of str or a Charset-like object which has a header_encode method. Default is 'utf-8'. Úasciiz%s <%s>rú"z\\\g<0>z %s%s%s <%s>) r)r*Ú isinstanceÚstrrZ header_encodeÚ specialsreÚsearchÚ escapesreÚsub)ZpairÚcharsetÚnameÚaddressZ encoded_nameZquotesrrrrus       rccs\d}d}t|ƒD]8\}}|r0|d|fVd}q|dkr>d}q||fVq|rX|dfVdS)NrFú\T)Ú enumerate)ÚaddrÚposÚescapeÚchrrrÚ_iter_escaped_chars–s rDcCsŽd|vr |Sd}d}g}t|ƒD]D\}}|dkr |dur>|}q ||krX| |||…¡|d}d}q |t|ƒkr„| ||d…¡d |¡S)z Strip real names between quotes.r4rNér)rDÚappendÚlenÚjoin)r@ÚstartZopen_posÚresultrArCrrrÚ_strip_quoted_realnames¥s  rKT)ÚstrictcCs¤|dkrtƒ}|s4t dd„|Dƒ¡}t|ƒ}|jSdd„|Dƒ}t|ƒ}t |¡}t|ƒ}t|jƒ}d}|D]}t|ƒ}|d| d¡7}qnt |ƒ|kr d gS|S) zñReturn a list of (REALNAME, EMAIL) or ('','') for each fieldvalue. When parsing fails for a fieldvalue, a 2-tuple of ('', '') is returned in its place. If strict is true, use a strict parser which rejects malformed inputs. Ncss|]}t|ƒVqdS)N©r6©Ú.0ÚvrrrÚ Øózgetaddresses..cSsg|] }t|ƒ‘qSrrMrNrrrÚ ÜrRz getaddresses..rrEú,©rr) rÚ COMMASPACErHÚ _AddressListÚ addresslistÚ_pre_parse_validationÚ_post_parse_validationrKÚcountrG)Z fieldvaluesrLÚallÚar@rJÚnrPrrrrÀs$     rcCsVt|ƒ}d}t|ƒD]8\}}|dkr.|d7}q|dkr|d8}|dkrdSq|dkS)Nrú(rEú)F)rKrD)r@ZopensrArCrrrÚ_check_parenthesisñs racCs(g}|D]}t|ƒsd}| |¡q|S)Nz('', ''))rarF)Zemail_header_fieldsÚaccepted_valuesrPrrrrYs  rYcCs,g}|D]}d|dvrd}| |¡q|S)Nú[rErU)rF)Zparsed_email_header_tuplesrbrPrrrrZ s   rZc CsHdgd¢|d|dgd¢|dd|d|d|d |d |fS) Nz"%s, %02d %s %04d %02d:%02d:%02d %s)ZMonZTueZWedZThuZFriZSatZSunéé) ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecrErééér)Ú timetupleÚzonerrrÚ_format_timetuple_and_zones ÿúrkFcCsR|durt ¡}|s|r,tj |tjj¡}n tj |¡}|rH| ¡}d}t||ƒS)aƒReturns a date string as specified by RFC 2822, e.g.: Fri, 09 Nov 2001 01:08:47 -0000 Optional timeval if given is a floating point time value as accepted by gmtime() and localtime(), otherwise the current time is used. Optional localtime is a flag that when True, interprets timeval, and returns a date relative to the local timezone instead of UTC, properly taking daylight savings time into account. Optional argument usegmt means that the timezone is written out as an ascii string, not numeric one (so "GMT" instead of "+0000"). This is needed for HTTP, and is only used when localtime==False. NF)ÚtimeÚdatetimeZ fromtimestampÚtimezoneÚutcZutcfromtimestampÚ astimezoner)ÚtimevalÚ localtimeÚusegmtÚdtrrrrs rcCsV| ¡}|r2|jdus$|jtjjkr,tdƒ‚d}n|jdurBd}n | d¡}t||ƒS)a$Turn a datetime into a date string as specified in RFC 2822. If usegmt is True, dt must be an aware datetime with an offset of zero. In this case 'GMT' will be rendered instead of the normal +0000 required by RFC2822. This is to support HTTP headers involving date stamps. Nz%usegmt option requires a UTC datetimeZGMTz-0000z%z)riÚtzinformrnroÚ ValueErrorÚstrftimerk)rtrsÚnowrjrrrr<s  rcCs^tt ¡dƒ}t ¡}t d¡}|dur0d}nd|}|durHt ¡}d|||||f}|S)a{Returns a string suitable for RFC 2822 compliant Message-ID, e.g: <142480216486.20800.16526388040877946887@nightshade.la.mastaler.com> Optional idstring if given is a string used to strengthen the uniqueness of the message id. Optional domain if given provides the portion of the message id after the '@'. It defaults to the locally defined hostname. édé@NrÚ.z<%d.%d.%d%s@%s>)ÚintrlrÚgetpidÚrandomÚ getrandbitsÚsocketÚgetfqdn)ZidstringÚdomainrqÚpidÚrandintZmsgidrrrr Os  r cCsNt|ƒ�^}}|dur(tj|dd…ŽStj|dd…dt tj|d�¡iŽS)Nrdru©Úseconds)rrmrnÚ timedelta)ÚdataZdtupleÚtzrrrrfs ÿrcCs„|dkrtƒ}|s,t|ƒj}|s$dS|dSt|tƒr>|d}t|tƒsLdSt|gƒd}tt|ƒjƒ}|rxt|ƒdkr|dS|dS)a Parse addr into its constituent realname and email address parts. Return a tuple of realname and email address, unless the parse fails, in which case return a 2-tuple of ('', ''). If strict is True, use a strict parser which rejects malformed inputs. NrUrrE) rrWrXr5Úlistr6rYrZrG)r@rLÚaddrsrrrr ns    r cCs`t|ƒdkr\| d¡r<| d¡r<|dd… dd¡ dd¡S| d¡r\| d¡r\|dd…S|S) zRemove quotes from a string.rEr4éÿÿÿÿz\\r>z\"ú<ú>)rGÚ startswithÚendswithr/rMrrrr’s   rcCs&| td¡}t|ƒdkr"dd|fS|S)z#Decode string according to RFC 2231reN)ÚsplitÚTICKrG)r+Úpartsrrrržs   rcCsDtjj|d|pdd�}|dur*|dur*|S|dur6d}d|||fS)zÜEncode string according to RFC 2231. If neither charset nor language is given, then s is returned as-is. If charset is given but not language, the string is encoded using the empty string for language. rr3)ÚsafeÚencodingNz%s'%s'%s)ÚurllibÚparser)r+r;Úlanguagerrrr¦s rz&^(?P\w+)\*((?P[0-9]+)\*?)?$c Cs@|dg}i}|dd…D]x\}}| d¡}t|ƒ}t |¡}|r|| dd¡\}}|durbt|ƒ}| |g¡ |||f¡q| |dt|ƒf¡q|�r<|  ¡D]˜\}}g}d} |  ¡|D],\}} }|ràt j j| d d �} d } | | ¡q¾tt  |¡ƒ}| �r(t|ƒ\} } }| || | d|ff¡q¢| |d|f¡q¢|S) zDecode parameters list according to RFC 2231. params is a sequence of 2-tuples containing (param name, string value). rrENÚ*r<Únumz"%s"Fzlatin-1)r•T)r�rÚrfc2231_continuationÚmatchÚgroupr|Ú setdefaultrFrÚitemsÚsortr–r—Ú EMPTYSTRINGrHr) ÚparamsÚ new_paramsZrfc2231_paramsr<ÚvalueÚencodedÚmoršZ continuationsZextendedr+r;r˜rrrr¸s8    rr/úus-asciicCslt|tƒrt|ƒdkrt|ƒS|\}}}|dur4|}t|dƒ}zt|||ƒWStyft|ƒYS0dS)Nrfzraw-unicode-escape)r5ÚtuplerGrÚbytesr6Ú LookupError)r¤ÚerrorsZfallback_charsetr;r˜ÚtextZrawbytesrrrrès   rrŒc Cs|durtj tjj¡ ¡S|jdur.| ¡S| ¡dd…|f}t |¡}t  |¡}z tj |j d�}t ||j ¡}Wn~t yö|tjt |¡dd…Ž}tjo°|jdk}|r¼tjntj }|tj |d�krèt |tj|¡}n t |¡}Yn0|j|d�S)aÅReturn local time as an aware datetime object. If called without arguments, return current time. Otherwise *dt* argument should be a datetime instance, and it is converted to the local time zone according to the system time zone database. If *dt* is naive (that is, dt.tzinfo is None), it is assumed to be in local time. In this case, a positive or zero value for *isdst* causes localtime to presume initially that summer time (for example, Daylight Saving Time) is or is not (respectively) in effect for the specified time. A negative value for *isdst* causes the localtime() function to attempt to divine whether summer time is in effect for the specified time. NrŒr…rdr)ru)rmrxrnrorprurirlÚmktimerrr‡Ú tm_gmtoffÚtm_zoneÚAttributeErrorÚgmtimeÚdaylightÚtm_isdstÚaltzoneÚtznamer/) rtZisdstZtmr†ZlocaltmZdeltar‰ÚdstZgmtoffrrrrrs$    rr)r-)NFF)F)NN)NN)r/r§)NrŒ)8Ú__doc__Ú__all__rÚrerlr~r€rmÚ urllib.parser–Zemail._parseaddrrrrWr r r rZ email.charsetrrVr¡Z UEMPTYSTRINGZCRLFr’Úcompiler7r9r#rrrr,r2rrDrKZsupports_strict_parsingrrarYrZrkrrr rr rrrÚASCIIr›rrrrrrrrÚsf        !1     $  ÿ0ÿ