/usr/lib64/python3.9/http/__pycache__
NameSizeModeActions
client.cpython-39.opt-1.pyc354660644editdlrm
client.cpython-39.opt-2.pyc259380644editdlrm
client.cpython-39.pyc355390644editdlrm
cookiejar.cpython-39.opt-1.pyc533480644editdlrm
cookiejar.cpython-39.opt-2.pyc377110644editdlrm
cookiejar.cpython-39.pyc535050644editdlrm
cookies.cpython-39.opt-1.pyc150290644editdlrm
cookies.cpython-39.opt-2.pyc106320644editdlrm
cookies.cpython-39.pyc150610644editdlrm
server.cpython-39.opt-1.pyc350320644editdlrm
server.cpython-39.opt-2.pyc229860644editdlrm
server.cpython-39.pyc350320644editdlrm
__init__.cpython-39.opt-1.pyc64130644editdlrm
__init__.cpython-39.opt-2.pyc55540644editdlrm
__init__.cpython-39.pyc64130644editdlrm
Edit: /usr/lib64/python3.9/http/__pycache__/cookiejar.cpython-39.pyc (53505B)
a ´i#,ã@sâdZgd¢ZddlZddlZddlZddlZddlZddlZddl Zddl Z ddl Z ddlmZdZdadd„Zee jjƒZdZd d „Zd Zd d „Zgd¢Zgd¢ZgZeD]Ze e  ¡¡q¬dedd„Z!dfdd„Z"dddddœZ#e $dej%¡Z&dd„Z'dd„Z(e $dej%¡Z)e $dej*ej%B¡Z+e $dej,ej%B¡Z-dd„Z.e $dej,ej%B¡Z/d d!„Z0d"d#„Z1e $d$¡Z2e $d%¡Z3e $d&¡Z4e $d'¡Z5d(d)„Z6e $d*¡Z7d+d,„Z8d-d.„Z9d/d0„Z:e $d1ej%¡Z;d2d3„Zd8d9„Z?e $d:ej%¡Z@d;d<„ZAd=d>„ZBd?d@„ZCdAdB„ZDdCZEe $dD¡ZFdEdF„ZGdGdH„ZHdIdJ„ZIdKdL„ZJGdMdN„dNƒZKGdOdP„dPƒZLGdQdR„dReLƒZMdSdT„ZNdUdV„ZOGdWdX„dXƒZPGdYdZ„dZƒZQGd[d\„d\eRƒZSGd]d^„d^eQƒZTd_d`„ZUGdadb„dbeTƒZVGdcdd„ddeTƒZWdS)gaªHTTP cookie handling for web clients. This module has (now fairly distant) origins in Gisle Aas' Perl module HTTP::Cookies, from the libwww-perl library. Docstrings, comments and debug strings in this code refer to the attributes of the HTTP cookie system as cookie-attributes, to distinguish them clearly from Python attributes. Class diagram (note that BSDDBCookieJar and the MSIE* classes are not distributed with the Python standard library, but are available from http://wwwsearch.sf.net/): CookieJar____ / \ \ FileCookieJar \ \ / | \ \ \ MozillaCookieJar | LWPCookieJar \ \ | | \ | ---MSIEBase | \ | / | | \ | / MSIEDBCookieJar BSDDBCookieJar |/ MSIECookieJar )ÚCookieÚ CookieJarÚ CookiePolicyÚDefaultCookiePolicyÚ FileCookieJarÚ LWPCookieJarÚ LoadErrorÚMozillaCookieJaréN)ÚtimegmFcGs(tsdStsddl}| d¡atj|ŽS)Nr zhttp.cookiejar)ÚdebugÚloggerÚloggingÚ getLogger)Úargsr ©rú&/usr/lib64/python3.9/http/cookiejar.pyÚ_debug,s  rzQa filename was not supplied (nor was the CookieJar instance initialised with one)cCsJddl}ddl}ddl}| ¡}| d|¡| ¡}|jd|dd�dS)Nr zhttp.cookiejar bug! %sé)Ú stacklevel)ÚioÚwarningsÚ tracebackÚStringIOÚ print_excÚgetvalueÚwarn)rrrÚfÚmsgrrrÚ_warn_unhandled_exception:s  ri²cCs¨|dd…\}}}}}}|tkr d|kr4dkr nnhd|krLdkr nnPd|krddkr nn8d|kr|dkr nn d|kr”dkr nnt|ƒSdSdS) Nééé ér éé;é=)Ú EPOCH_YEARr )ÚttÚyearÚmonthZmdayÚhourÚminÚsecrrrÚ_timegmIs 8ÿÿ ÿÿ ÿÿ r-)ZMonZTueZWedZThuZFriZSatZSun) ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDeccCs@|durtj ¡}n tj |¡}d|j|j|j|j|j|jfS)aHReturn a string representing time in seconds since epoch, t. If the function is called without an argument, it will use the current time. The format of the returned string is like "YYYY-MM-DD hh:mm:ssZ", representing Universal Time (UTC, aka GMT). An example of this format is: 1994-11-24 08:49:37Z Nz%04d-%02d-%02d %02d:%02d:%02dZ) ÚdatetimeÚutcnowÚutcfromtimestampr(r)Údayr*ÚminuteÚsecond©ÚtZdtrrrÚ time2isozWs   ÿr6cCsR|durtj ¡}n tj |¡}dt| ¡|jt|jd|j|j |j |j fS)zðReturn a string representing time in seconds since epoch, t. If the function is called without an argument, it will use the current time. The format of the returned string is like this: Wed, DD-Mon-YYYY HH:MM:SS GMT Nz#%s, %02d-%s-%04d %02d:%02d:%02d GMTr ) r.r/r0ÚDAYSZweekdayr1ÚMONTHSr)r(r*r2r3r4rrrÚ time2netscapejs   þr9)ZGMTÚUTCZUTÚZz^([-+])?(\d\d?):?(\d\d)?$cCsjd}|tvrd}nTt |¡}|rfdt| d¡ƒ}| d¡rR|dt| d¡ƒ}| d¡dkrf| }|S)Nr iréé<r ú-)Ú UTC_ZONESÚ TIMEZONE_REÚsearchÚintÚgroup)ÚtzÚoffsetÚmrrrÚoffset_from_tz_string�s  rGc CsŠt|ƒ}|tjkrdSzt | ¡¡d}WnZty†z t|ƒ}Wnty\YYdS0d|krrdkr|nn|}nYdSYn0|dur”d}|dur d}|dur¬d}t|ƒ}t|ƒ}t|ƒ}t|ƒ}|dk�r2t t ¡¡d}|d} |} ||| }| | } t | ƒdk�r2| dk�r*|d}n|d}t |||||||fƒ} | du�r†|du�r`d}|  ¡}t |ƒ} | du�r~dS| | } | S)Nr r!r ièédé2r:) rBr.ZMAXYEARÚ MONTHS_LOWERÚindexÚlowerÚ ValueErrorÚtimeÚ localtimeÚabsr-ÚupperrG) r1ÚmonÚyrÚhrr+r,rDZimonZcur_yrrFÚtmpr5rErrrÚ _str2time�sN              rVzV^[SMTWF][a-z][a-z], (\d\d) ([JFMASOND][a-z][a-z]) (\d\d\d\d) (\d\d):(\d\d):(\d\d) GMT$z+^(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)[a-z]*,?\s*aò^ (\d\d?) # day (?:\s+|[-\/]) (\w+) # month (?:\s+|[-\/]) (\d+) # year (?: (?:\s+|:) # separator before clock (\d\d?):(\d\d) # hour:min (?::(\d\d))? # optional seconds )? # optional clock \s* (?: ([-+]?\d{2,4}|(?![APap][Mm]\b)[A-Za-z]+) # timezone \s* )? (?: \(\w+\) # ASCII representation of timezone in parens. \s* )?$c CsÜt |¡}|rl| ¡}t |d ¡¡d}t|dƒ|t|dƒt|dƒt|dƒt|dƒf}t|ƒS|  ¡}t   d|d¡}dgd \}}}}}} } t  |¡}|durÄ| ¡\}}}}}} } ndSt |||||| | ƒS) aÕReturns time in seconds since epoch of time represented by a string. Return value is an integer. None is returned if the format of str is unrecognized, the time is outside the representable range, or the timezone string is not recognized. If the string contains no timezone, UTC is assumed. The timezone in the string may be numerical (like "-0800" or "+0100") or a string timezone (like "UTC", "GMT", "BST" or "EST"). Currently, only the timezone strings equivalent to UTC (zero offset) are known to the function. The function loosely parses the following formats: Wed, 09 Feb 1994 22:23:32 GMT -- HTTP format Tuesday, 08-Feb-94 14:15:29 GMT -- old rfc850 HTTP format Tuesday, 08-Feb-1994 14:15:29 GMT -- broken rfc850 HTTP format 09 Feb 1994 22:23:32 GMT -- HTTP format (no weekday) 08-Feb-94 14:15:29 GMT -- rfc850 format (no weekday) 08-Feb-1994 14:15:29 GMT -- broken rfc850 format (no weekday) The parser ignores leading and trailing whitespace. The time may be absent. If the year is given with only 2 digits, the function will select the century that makes the year closest to the current date. r rr r<ééÚNé)ÚSTRICT_DATE_RErAÚgroupsrJrKrLrBÚfloatr-ÚlstripÚ WEEKDAY_REÚsubÚLOOSE_HTTP_DATE_RErV) ÚtextrFÚgrRr'r1rSrTr+r,rDrrrÚ http2timeás  ÿ rdaÖ^ (\d{4}) # year [-\/]? (\d\d?) # numerical month [-\/]? (\d\d?) # day (?: (?:\s+|[-:Tt]) # separator before clock (\d\d?):?(\d\d) # hour:min (?::?(\d\d(?:\.\d*)?))? # optional seconds (and fractional) )? # optional clock \s* (?: ([-+]?\d\d?:?(:?\d\d)? |Z|z) # timezone (Z is "zero meridian", i.e. GMT) \s* )?$c Csd| ¡}dgd\}}}}}}}t |¡}|durL| ¡\}}}}}}}} ndSt|||||||ƒS)av As for http2time, but parses the ISO 8601 formats: 1994-02-03 14:15:29 -0100 -- ISO 8601 format 1994-02-03 14:15:29 -- zone is optional 1994-02-03 -- only date 1994-02-03T14:15:29 -- Use T as separator 19940203T141529Z -- ISO 8601 compact format 19940203 -- only date NrZ)r^Ú ISO_DATE_RErAr\rV) rbr1rRrSrTr+r,rDrFÚ_rrrÚiso2time+s  rgcCs*| d¡\}}|jd|…|j|d…S)z)Return unmatched part of re.Match object.r N)ÚspanÚstring)ÚmatchÚstartÚendrrrÚ unmatchedLsrmz^\s*([^=\s;,]+)z&^\s*=\s*\"([^\"\\]*(?:\\.[^\"\\]*)*)\"z^\s*=\s*([^\s;,]*)z\\(.)c Cs0t|tƒrJ‚g}|D�]}|}g}|�rt |¡}|r¶t|ƒ}| d¡}t |¡}|rxt|ƒ}| d¡}t d|¡}n.t  |¡}|r¢t|ƒ}| d¡}|  ¡}nd}|  ||f¡q$|  ¡  d¡rè|  ¡dd…}|râ|  |¡g}q$t dd|¡\}} | dk�sJd|||fƒ‚|}q$|r|  |¡q|S) amParse header values into a list of lists containing key,value pairs. The function knows how to deal with ",", ";" and "=" as well as quoted values after "=". A list of space separated tokens are parsed as if they were separated by ";". If the header_values passed as argument contains multiple values, then they are treated as if they were a single value separated by comma ",". This means that this function is useful for parsing header fields that follow this syntax (BNF as from the HTTP/1.1 specification, but we relax the requirement for tokens). headers = #header header = (token | parameter) *( [";"] (token | parameter)) token = 1* separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT quoted-string = ( <"> *(qdtext | quoted-pair ) <"> ) qdtext = > quoted-pair = "\" CHAR parameter = attribute "=" value attribute = token value = token | quoted-string Each header is represented by a list of key/value pairs. The value for a simple token (not part of a parameter) is None. Syntactically incorrect headers will not necessarily be parsed as you would want. This is easier to describe with some examples: >>> split_header_words(['foo="bar"; port="80,81"; discard, bar=baz']) [[('foo', 'bar'), ('port', '80,81'), ('discard', None)], [('bar', 'baz')]] >>> split_header_words(['text/html; charset="iso-8859-1"']) [[('text/html', None), ('charset', 'iso-8859-1')]] >>> split_header_words([r'Basic realm="\"foo\bar\""']) [[('Basic', None), ('realm', '"foobar"')]] r z\1Nú,z^[=\s;]*rYr z&split_header_words bug: '%s', '%s', %s)Ú isinstanceÚstrÚHEADER_TOKEN_RErArmrCÚHEADER_QUOTED_VALUE_REÚHEADER_ESCAPE_REr`ÚHEADER_VALUE_REÚrstripÚappendr^Ú startswithÚreÚsubn) Z header_valuesÚresultrbZ orig_textÚpairsrFÚnameÚvalueZnon_junkZ nr_junk_charsrrrÚsplit_header_wordsUsF-         ÿÿr~ú([\"\\])cCs|g}|D]h}g}|D]F\}}|durPt d|¡sDt d|¡}d|}d||f}| |¡q|r| d |¡¡qd |¡S)a»Do the inverse (almost) of the conversion done by split_header_words. Takes a list of lists of (key, value) pairs and produces a single header value. Attribute values are quoted if needed. >>> join_header_words([[("text/plain", None), ("charset", "iso-8859-1")]]) 'text/plain; charset="iso-8859-1"' >>> join_header_words([[("text/plain", None)], [("charset", "iso-8859-1")]]) 'text/plain, charset="iso-8859-1"' Nz^\w+$ú\\\1z"%s"ú%s=%sú; ú, )rxrAÚHEADER_JOIN_ESCAPE_REr`rvÚjoin)ZlistsÚheadersr{ÚattrÚkÚvrrrÚjoin_header_words«s      rŠcCs0| d¡r|dd…}| d¡r,|dd…}|S)Nú"r éÿÿÿÿ)rwÚendswith©rbrrrÚ strip_quotesÄs     r�c Csúd}g}|D]è}g}d}t| d¡ƒD]°\}}| ¡}| d¡\}} } | ¡}|sb|dkr&qØnq&| rn|  ¡nd} |dkrÈ| ¡} | |vrŽ| }|dkr¬| dur¦t| ƒ} d}n|d krÈ| durÈtt| ƒƒ} | || f¡q&|r |sê| d ¡| |¡q |S) a5Ad-hoc parser for Netscape protocol cookie-attributes. The old Netscape cookie format for Set-Cookie can for instance contain an unquoted "," in the expires field, so we have to use this ad-hoc parser instead of split_header_words. XXX This may not make the best possible effort to parse all the crap that Netscape Cookie headers contain. Ronald Tschalar's HTTPClient parser is probably better, so could do worse than following that if this ever gives any trouble. Currently, this is also used for parsing RFC 2109 cookies. )ÚexpiresÚdomainÚpathÚsecureÚversionÚportúmax-ageFú;ú=r Nr”Tr�)r”Ú0)Ú enumerateÚsplitÚstripÚ partitionrLr�rdrv) Z ns_headersZ known_attrsrzZ ns_headerr{Ú version_setÚiiZparamÚkeyÚsepÚvalÚlcrrrÚparse_ns_headersËs>   r¤z\.\d+$cCs:t |¡rdS|dkrdS|ddks2|ddkr6dSdS)z*Return True if text is a host domain name.FrYr Ú.rŒT©ÚIPV4_RErArŽrrrÚis_HDNs r¨cCsl| ¡}| ¡}||krdSt|ƒs(dS| |¡}|dksB|dkrFdS| d¡sTdSt|dd…ƒshdSdS)aýReturn True if domain A domain-matches domain B, according to RFC 2965. A and B may be host domain names or IP addresses. RFC 2965, section 1: Host names can be specified either as an IP address or a HDN string. Sometimes we compare one host name with another. (Such comparisons SHALL be case-insensitive.) Host A's name domain-matches host B's if * their host name strings string-compare equal; or * A is a HDN string and has the form NB, where N is a non-empty name string, B has the form .B', and B' is a HDN string. (So, x.y.com domain-matches .Y.com but not Y.com.) Note that domain-match is not a commutative operation: a.b.c.com domain-matches .c.com, but not the reverse. TFrŒr r¥r N)rLr¨Úrfindrw)ÚAÚBÚirrrÚ domain_matchs  r­cCst |¡rdSdS)zdReturn True if text is a sort-of-like a host domain name. For accepting/blocking domains. FTr¦rŽrrrÚliberal_is_HDNFs r®cCs`| ¡}| ¡}t|ƒr t|ƒs0||kr,dSdS| d¡}|rL| |¡rLdS|s\||kr\dSdS)z\For blocking/accepting domains. A and B may be host domain names or IP addresses. TFr¥)rLr®rwr�)rªr«Ú initial_dotrrrÚuser_domain_matchPs  r°z:\d+$cCsB| ¡}tj |¡d}|dkr,| dd¡}t d|d¡}| ¡S)zˆReturn request-host, as defined by RFC 2965. Variation from RFC: returned value is lowercased, for convenient comparison. r rYZHost)Ú get_full_urlÚurllibÚparseÚurlparseZ get_headerÚ cut_port_rer`rL)ÚrequestÚurlÚhostrrrÚ request_hostes  r¹cCs4t|ƒ}}| d¡dkr,t |¡s,|d}||fS)zzReturn a tuple (request-host, effective request-host name). As defined by RFC 2965, except both are lowercased. r¥rŒú.local)r¹Úfindr§rA)r¶ÚerhnÚreq_hostrrrÚeff_request_hostus r¾cCs4| ¡}tj |¡}t|jƒ}| d¡s0d|}|S)z6Path component of request-URI, as defined by RFC 2965.ú/)r±r²r³ÚurlsplitÚ escape_pathr’rw)r¶r·Úpartsr’rrrÚ request_path€s    rÃcCs^|j}| d¡}|dkrV||dd…}z t|ƒWqZtyRtd|ƒYdS0nt}|S)Nú:r r znonnumeric port: '%s')r¸r»rBrMrÚDEFAULT_HTTP_PORT)r¶r¸r¬r•rrrÚ request_portŠs     rÆz%/;:@&=+$,!~*'()z%([0-9a-fA-F][0-9a-fA-F])cCsd| d¡ ¡S)Nz%%%sr )rCrQ)rjrrrÚuppercase_escaped_charœsrÇcCstj |t¡}t t|¡}|S)zEEscape any invalid characters in HTTP URL, and uppercase all escapes.)r²r³ÚquoteÚHTTP_PATH_SAFEÚESCAPED_CHAR_REr`rÇ)r’rrrrÁžs  rÁcCsP| d¡}|dkrL||dd…}| d¡}t|ƒrL|dksD|dkrLd|S|S)aBReturn reach of host h, as defined by RFC 2965, section 1. The reach R of a host name H is defined as follows: * If - H is the host domain name of a host; and, - H has the form A.B; and - A has no embedded (that is, interior) dots; and - B has at least one embedded dot, or B is the string "local". then the reach of H is .B. * Otherwise, the reach of H is H. >>> reach("www.acme.com") '.acme.com' >>> reach("acme.com") 'acme.com' >>> reach("acme.local") '.local' r¥r r NÚlocal)r»r¨)Úhr¬ÚbrrrÚreach¬s  rÎcCs$t|ƒ}t|t|jƒƒsdSdSdS)zÜ RFC 2965, section 3.3.6: An unverifiable transaction is to a third-party host if its request- host U does not domain-match the reach R of the request-host O in the origin transaction. TFN)r¹r­rÎZorigin_req_host)r¶r½rrrÚis_third_partyÏs rÏc@sNeZdZdZddd„Zdd„Zddd „Zd d „Zdd d „Zdd„Z dd„Z dS)raÐHTTP Cookie. This class represents both Netscape and RFC 2965 cookies. This is deliberately a very simple class. It just holds attributes. It's possible to construct Cookie instances that don't comply with the cookie standards. CookieJar.make_cookies is the factory function for Cookie objects -- it deals with cookie parsing, supplying defaults, and normalising to the representation used in this class. CookiePolicy is responsible for checking them to see whether they should be accepted from and returned to the server. Note that the port may be present in the headers, but unspecified ("Port" rather than"Port=80", for example); if this is the case, port is None. FcCs°|durt|ƒ}| dur$tt| ƒƒ} |dur<|dur)r•r‘r’r}r|)rÚÚpÚlimitZ namevaluerrrÚ__str__)s  zCookie.__str__cCslg}dD]$}t||ƒ}| d|t|ƒf¡q| dt|jƒ¡| dt|jƒ¡d|jjd |¡fS)N)r”r|r}r•rÐr‘rÑrÒr’rÓr“r�rÔrÕrÖr�zrest=%sz rfc2109=%sz%s(%s)rƒ)ÚgetattrrvÚreprrÙr×Ú __class__Ú__name__r…)rÚrr|r‡rrrÚ__repr__3s zCookie.__repr__)F)N)N) ríÚ __module__Ú __qualname__Ú__doc__rÜrßrârãrærérîrrrrràsö *   rc@s0eZdZdZdd„Zdd„Zdd„Zdd „Zd S) ra Defines which cookies get accepted from and returned to server. May also modify cookies, though this is probably a bad idea. The subclass DefaultCookiePolicy defines the standard rules for Netscape and RFC 2965 cookies -- override that if you want a customized policy. cCs tƒ‚dS)zÄReturn true if (and only if) cookie should be accepted from server. Currently, pre-expired cookies never get this far -- the CookieJar class deletes such cookies itself. N©ÚNotImplementedError©rÚÚcookier¶rrrÚset_okKszCookiePolicy.set_okcCs tƒ‚dS)zAReturn true if (and only if) cookie should be returned to server.NròrôrrrÚ return_okTszCookiePolicy.return_okcCsdS)zMReturn false if cookies should not be returned, given cookie domain. Tr)rÚr‘r¶rrrÚdomain_return_okXszCookiePolicy.domain_return_okcCsdS)zKReturn false if cookies should not be returned, given cookie path. Tr)rÚr’r¶rrrÚpath_return_ok]szCookiePolicy.path_return_okN)rírïrðrñrör÷rørùrrrrrBs  rc @süeZdZdZdZdZdZdZeeBZdddddddddeddd f d d „Z d d „Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zdd„Zd d!„Zd"d#„Zd$d%„Zd&d'„Zd(d)„Zd*d+„Zd,d-„Zd.d/„Zd0d1„Zd2d3„Zd4d5„Zd6d7„ZdS)8rzBImplements the standard rules for accepting and returning cookies.r rrWr NTF)ÚhttpsÚwsscCsv||_||_||_||_||_||_| |_| |_| |_| |_ | |_ |durVt |ƒ|_ nd|_ |durlt |ƒ}||_ dS)zAConstructor arguments should be passed as keyword arguments only.Nr)ÚnetscapeÚrfc2965Úrfc2109_as_netscapeÚ hide_cookie2Ú strict_domainÚstrict_rfc2965_unverifiableÚstrict_ns_unverifiableÚstrict_ns_domainÚstrict_ns_set_initial_dollarÚstrict_ns_set_pathÚsecure_protocolsÚtupleÚ_blocked_domainsÚ_allowed_domains)rÚÚblocked_domainsÚallowed_domainsrürýrþrÿrrrrrrrrrrrÜms" zDefaultCookiePolicy.__init__cCs|jS)z4Return the sequence of blocked domains (as a tuple).)r©rÚrrrr �sz#DefaultCookiePolicy.blocked_domainscCst|ƒ|_dS)z$Set the sequence of blocked domains.N)rr)rÚr rrrÚset_blocked_domains“sz'DefaultCookiePolicy.set_blocked_domainscCs |jD]}t||ƒrdSqdSrä)rr°)rÚr‘Zblocked_domainrrrÚ is_blocked—s  zDefaultCookiePolicy.is_blockedcCs|jS)z=Return None, or the sequence of allowed domains (as a tuple).)r r rrrr �sz#DefaultCookiePolicy.allowed_domainscCs|durt|ƒ}||_dS)z-Set the sequence of allowed domains, or None.N)rr )rÚr rrrÚset_allowed_domains sz'DefaultCookiePolicy.set_allowed_domainscCs.|jdurdS|jD]}t||ƒrdSqdS)NFT)r r°)rÚr‘Zallowed_domainrrrÚis_not_allowed¦s    z"DefaultCookiePolicy.is_not_allowedcCsNtd|j|jƒ|jdusJ‚dD]&}d|}t||ƒ}|||ƒs"dSq"dS)zØ If you override .set_ok(), be sure to call this method. If it returns false, so should your subclass (assuming your subclass wants to be more strict about which cookies to accept). ú - checking cookie %s=%sN)r”Ú verifiabilityr|r’r‘r•Zset_ok_FT©rr|r}rê©rÚrõr¶ÚnZfn_nameÚfnrrrrö®s  zDefaultCookiePolicy.set_okcCsZ|jdurtd|j|jƒdS|jdkr:|js:tdƒdS|jdkrV|jsVtdƒdSdS)Nz0 Set-Cookie2 without version attribute (%s=%s)Fr ú$ RFC 2965 cookies are switched offú$ Netscape cookies are switched offT)r”rr|r}rýrürôrrrÚset_ok_versionÁs ÿz"DefaultCookiePolicy.set_ok_versioncCsJ|jrFt|ƒrF|jdkr*|jr*tdƒdS|jdkrF|jrFtdƒdSdS©Nr z> third-party RFC 2965 cookie during unverifiable transactionFz> third-party Netscape cookie during unverifiable transactionT©Z unverifiablerÏr”rrrrôrrrÚset_ok_verifiabilityÐsz(DefaultCookiePolicy.set_ok_verifiabilitycCs0|jdkr,|jr,|j d¡r,td|jƒdSdS)Nr ú$z' illegal name (starts with '$'): '%s'FT)r”rr|rwrrôrrrÚ set_ok_nameÜs  ÿ zDefaultCookiePolicy.set_ok_namecCsL|jrHt|ƒ}|jdks(|jdkrH|jrH| |j|¡sHtd|j|ƒdSdS)Nr z7 path attribute %s is not a prefix of request path %sFT)rÓrÃr”rrùr’r)rÚrõr¶Úreq_pathrrrÚ set_ok_pathås ÿÿ þÿzDefaultCookiePolicy.set_ok_pathc Csê| |j¡rtd|jƒdS| |j¡r8td|jƒdS|j�ræt|ƒ\}}|j}|jrÌ| d¡dkrÌ| d¡}| dd|¡}|dkrÌ||dd…}||d|…} |   ¡dvrÌt |ƒdkrÌtd |ƒdS|  d¡rä|dd…} n|} |   d¡dk} | �s|d k�rtd |ƒdS|j dk�rX| |¡�sX|  d¡�sXd| |¡�sXtd ||ƒdS|j dk�sr|j|j@�rŽt||ƒ�sŽtd ||ƒdS|j dk�s¨|j|j@�ræ|dt |ƒ …} |   d¡dk�ræt |¡�sætd| |ƒdSdS)Nú" domain %s is in user block-listFú& domain %s is not in user allow-listr¥rr r )ÚcoZacZcomZeduZorgÚnetZgovZmilrBZaeroZbizÚcatZcoopÚinfoZjobsZmobiZmuseumr|ZproZtravelÚeuz& country-code second level domain %srºz/ non-local domain %s contains no embedded dotzO effective request-host %s (even with added initial dot) does not end with %sz5 effective request-host %s does not domain-match %sz. host prefix %s for domain %s contains a dotT)rr‘rrrÑr¾rÚcountr©rLÚlenrwr»r”r�rÚDomainRFC2965Matchr­ÚDomainStrictNoDotsr§rA) rÚrõr¶r½r¼r‘r¬ÚjZtldZsldZundotted_domainZ embedded_dotsZ host_prefixrrrÚ set_ok_domainðsv        ý  ÿ  ÿ þþ  ÿ ÿ  ÿÿÿz!DefaultCookiePolicy.set_ok_domainc Cs†|jr‚t|ƒ}|durd}nt|ƒ}|j d¡D]>}z t|ƒWn ty`td|ƒYdS0||kr0q‚q0td||jƒdSdS)NÚ80rnz bad port %s (not numeric)Fz$ request port (%s) not found in %sT)rÐrÆrpr•r›rBrMr©rÚrõr¶Zreq_portrçrrrÚ set_ok_port+s$    ÿzDefaultCookiePolicy.set_ok_portcCs@td|j|jƒdD]&}d|}t||ƒ}|||ƒsdSqdS)zÛ If you override .return_ok(), be sure to call this method. If it returns false, so should your subclass (assuming your subclass wants to be more strict about which cookies to return). r)r”rr“r�r•r‘Z return_ok_FTrrrrrr÷@s   zDefaultCookiePolicy.return_okcCs<|jdkr|jstdƒdS|jdkr8|js8tdƒdSdS)Nr rFrT)r”rýrrürôrrrÚreturn_ok_versionRsz%DefaultCookiePolicy.return_ok_versioncCsJ|jrFt|ƒrF|jdkr*|jr*tdƒdS|jdkrF|jrFtdƒdSdSrrrôrrrÚreturn_ok_verifiability[sz+DefaultCookiePolicy.return_ok_verifiabilitycCs"|jr|j|jvrtdƒdSdS)Nz( secure cookie with non-secure requestFT)r“ÚtyperrrôrrrÚreturn_ok_securegsz$DefaultCookiePolicy.return_ok_securecCs| |j¡rtdƒdSdS)Nz cookie expiredFT)ræÚ_nowrrôrrrÚreturn_ok_expiresms z%DefaultCookiePolicy.return_ok_expirescCsN|jrJt|ƒ}|durd}|j d¡D]}||kr&qJq&td||jƒdSdS)Nr.rnz0 request port %s does not match cookie port %sFT)r•rÆr›rr/rrrÚreturn_ok_portssÿz"DefaultCookiePolicy.return_ok_portcCs®t|ƒ\}}|j}|r*| d¡s*d|}n|}|jdkr^|j|j@r^|js^||kr^tdƒdS|jdkr‚t||ƒs‚td||ƒdS|jdkrªd|  |¡sªtd||ƒdSdS)Nr¥r zQ cookie with unspecified domain does not string-compare equal to request domainFzQ effective request-host name %s does not domain-match RFC 2965 cookie domain %sz; request-host %s does not match Netscape cookie domain %sT) r¾r‘rwr”rÚDomainStrictNonDomainrÑrr­r�)rÚrõr¶r½r¼r‘Ú dotdomainrrrÚreturn_ok_domain�s2    ÿþþÿÿz$DefaultCookiePolicy.return_ok_domaincCs˜t|ƒ\}}| d¡sd|}| d¡s0d|}|rH| d¡sHd|}n|}| |¡sd| |¡sddS| |¡r|td|ƒdS| |¡r”td|ƒdSdS)Nr¥Fr!r"T)r¾rwr�rrr)rÚr‘r¶r½r¼r9rrrrøœs"        z$DefaultCookiePolicy.domain_return_okcCsbtd|ƒt|ƒ}t|ƒ}||kr&dS| |¡rR| d¡sN|||d…dkrRdStd||ƒdS)Nz- checking cookie path=%sTr¿r z %s does not path-match %sF)rrÃr)rwr�)rÚr’r¶rZpathlenrrrrù¶s  ÿÿ z"DefaultCookiePolicy.path_return_ok) rírïrðrñr+r8r*Z DomainLiberalZ DomainStrictrÜr r rr rrrörrrr r-r0r÷r1r2r4r6r7r:rørùrrrrrcsPõ #   ;  rcCst| ¡ƒ}t|j|ƒSrÝ)ÚsortedÚkeysÚmaprà)Zadictr<rrrÚvals_sorted_by_keyÃs r>c csTt|ƒ}|D]B}d}z |jWnty0Yn0d}t|ƒEdH|s |Vq dS)zBIterates over nested mapping, depth-first, in sorted order by key.FTN)r>ÚitemsÚAttributeErrorÚ deepvalues)ÚmappingÚvaluesÚobjrrrrAÇs  rAc@s eZdZdS)ÚAbsentN©rírïrðrrrrrEÙórEc@süeZdZdZe d¡Ze d¡Ze d¡Ze d¡Z e d¡Z e dej ¡Z d3d d „Z d d „Zd d„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd4d%d&„Zd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„Z d1d2„Z!dS)5rz”Collection of HTTP cookies. You may not need to know about this class: try urllib.request.build_opener(HTTPCookieProcessor).open(url). z\Wrz\.?[^.]*z[^.]*z^\.+z^\#LWP-Cookies-(\d+\.\d+)NcCs(|durtƒ}||_t ¡|_i|_dSrÝ)rÚ_policyÚ _threadingÚRLockÚ _cookies_lockÚ_cookies©rÚÚpolicyrrrrÜês  zCookieJar.__init__cCs ||_dSrÝ)rHrMrrrÚ set_policyòszCookieJar.set_policycCsŒg}|j ||¡sgStd|ƒ|j|}| ¡D]T}|j ||¡sFq2||}| ¡D].}|j ||¡srtdƒqVtdƒ| |¡qVq2|S)Nz!Checking %s for cookies to returnz not returning cookiez it's a match) rHrørrLr<rùrCr÷rv)rÚr‘r¶ÚcookiesZcookies_by_pathr’Zcookies_by_namerõrrrÚ_cookies_for_domainõs     zCookieJar._cookies_for_domaincCs*g}|j ¡D]}| | ||¡¡q|S)z2Return a list of cookies to be returned to server.)rLr<ÚextendrQ)rÚr¶rPr‘rrrÚ_cookies_for_requestszCookieJar._cookies_for_requestc Cs<|jdd„dd�d}g}|D�]}|j}|sHd}|dkrH| d|¡|jdurz|j |j¡rz|dkrz|j d |j¡}n|j}|jdur˜| |j¡n| d |j|f¡|dkr|j rÊ| d |j ¡|j   d ¡�r|j }|j sú|  d ¡rú|d d…}| d|¡|jdurd}|j�r,|d|j}| |¡q|S)zÜReturn a list of cookie-attributes to be returned to server. like ['foo="bar"; $Path="/"', ...] The $Version attribute is also added when appropriate (currently only once per request). cSs t|jƒSrÝ)r)r’)ÚarrrÚrGz)CookieJar._cookie_attrs..T)r ÚreverseFr z $Version=%sNr€r�z $Path="%s"r¥r z $Domain="%s"z$Portz="%s")Úsortr”rvr}Ú non_word_rerAÚquote_rer`r|rÓr’r‘rwrÒr•rÐ) rÚrPržÚattrsrõr”r}r‘rçrrrÚ _cookie_attrssF    ÿÿ ÿ   zCookieJar._cookie_attrscCsÂtdƒ|j ¡z–tt ¡ƒ|j_|_| |¡}| |¡}|r^|  d¡s^|  dd  |¡¡|jj rœ|jj sœ|  d¡sœ|D]}|jdkr||  dd¡qœq|W|j ¡n |j ¡0| ¡dS)zžAdd correct Cookie: header to request (urllib.request.Request object). The Cookie2 header is also added unless policy.hide_cookie2 is true. Úadd_cookie_headerrr‚ZCookie2r z $Version="1"N)rrKÚacquirerBrNrHr5rSr[Z has_headerZadd_unredirected_headerr…rýrÿr”ÚreleaseÚclear_expired_cookies)rÚr¶rPrZrõrrrr\Is(     ÿÿ  zCookieJar.add_cookie_headerc Cs�g}d}d}|D�]x}|d\}}d}d} i} i} |dd…D�].\} } |  ¡}||vs`||vrd|} | |vrx| durxd} | | vr‚q>| dkr¬| dur¤td ƒd} �qp|  ¡} | d krÌ|rºq>| durÌtd ƒq>| d k�rd}z t| ƒ} Wn(t�ytd ƒd} Y�qpYn0d } |j| } | |v�s2| |v�rf| du�r\| dv�r\td| ƒd} �qp| | | <q>| | | <q>| �rxq| ||| | f¡q|S)aReturn list of tuples containing normalised cookie information. attrs_set is the list of lists of key,value pairs extracted from the Set-Cookie or Set-Cookie2 headers. Tuples are name, value, standard, rest, where name and value are the cookie name and value, standard is a dictionary containing the standard cookie-attributes (discard, secure, version, expires or max-age, domain, path and port) and rest is a dictionary containing the rest of the cookie-attributes. )rÔr“)r”r�r–r‘r’r•rÕÚ commenturlr Fr NTr‘z% missing value for domain attributer�zM missing or invalid value for expires attribute: treating as session cookier–z? missing or invalid (non-numeric) value for max-age attribute)r•rÕr`z! missing value for %s attribute)rLrrBrMr5rv)rÚÚ attrs_setÚ cookie_tuplesÚ boolean_attrsÚ value_attrsZ cookie_attrsr|r}Z max_age_setZ bad_cookieÚstandardrÛrˆr‰r£rrrÚ_normalized_cookie_tuplesjsh       ÿ   z#CookieJar._normalized_cookie_tuplescCs"|\}}}}| dt¡}| dt¡}| dt¡} | dt¡} | dd¡} | durrz t| ƒ} WntypYdS0| dd¡} | dd¡} | d d¡}| d d¡}|turÀ|d krÀd }t|ƒ}nXd}t|ƒ}| d ¡}|dk�r| dkrö|d|…}n|d|d…}t|ƒdk�rd }|tu}d}|�r8t|  d¡ƒ}|tu�rTt |ƒ\}}|}n|  d¡�shd|}d}| tu�rž| du�rŠt |ƒ} nd }t   dd | ¡} nd} | tu�r¶d} d } nF| |jk�rüz| |||¡Wnt�yèYn0td|||ƒdSt| ||| ||||||| | | |||ƒS)Nr‘r’r•r�r”r“FrÔrÕr`rYTr¿rŒr r r¥z\s+z2Expiring cookie, domain='%s', path='%s', name='%s')ràrErBrMrÁrÃr©r)Úboolrwr¾rÆrxr`r5ÚclearÚKeyErrorrr)rÚÚtupr¶r|r}rerÛr‘r’r•r�r”r“rÔrÕrÖrÓr¬rÑrÒr½r¼rÐrrrÚ_cookie_from_cookie_tupleËs„                       ÿöz#CookieJar._cookie_from_cookie_tuplecCs6| |¡}g}|D]}| ||¡}|r| |¡q|SrÝ)rfrkrv)rÚrar¶rbrPrjrõrrrÚ_cookies_from_attrs_set's   z!CookieJar._cookies_from_attrs_setcCsHt|jddƒ}|dur |jj }|D]}|jdkr$d|_|r$d|_q$dS)Nrþr Tr )rêrHrýr”r×)rÚrPZ rfc2109_as_nsrõrrrÚ_process_rfc2109_cookies0s  z"CookieJar._process_rfc2109_cookiesc Cs6| ¡}| dg¡}| dg¡}tt ¡ƒ|j_|_|jj}|jj}|sN|rf|sV|rf|s^|rf|sj|sjgSz| t |ƒ|¡}Wnt yšt ƒg}Yn0|�r2|�r2z| t |ƒ|¡} Wnt yØt ƒg} Yn0|  | ¡|�r"i} |D]} d| | j| j| jf<qò| fdd„} t| | ƒ} | �r2| | ¡|S)zAReturn sequence of Cookie objects extracted from response object.z Set-Cookie2z Set-CookieNcSs|j|j|jf}||vSrÝ)r‘r’r|)Z ns_cookieÚlookupr rrrÚno_matching_rfc2965isz3CookieJar.make_cookies..no_matching_rfc2965)r&Zget_allrBrNrHr5rýrürlr~Ú Exceptionrr¤rmr‘r’r|ÚfilterrR) rÚÚresponser¶r†Z rfc2965_hdrsZns_hdrsrýrürPZ ns_cookiesrnrõrorrrÚ make_cookies<sZ  ÿÿþþýýÿ   ÿ      zCookieJar.make_cookiescCsX|j ¡z|durX|durJtdƒ‚|j||=n|durj|j|=ni|_dS)aÑClear some cookies. Invoking this method without arguments will clear all cookies. If given a single argument, only cookies belonging to that domain will be removed. If given two arguments, cookies belonging to the specified path within that domain are removed. If given three arguments, then the cookie with the specified name, path and domain is removed. Raises KeyError if no matching cookie exists. Nz8domain and path must be given to remove a cookie by namez.domain must be given to remove cookies by path)rMrL)rÚr‘r’r|rrrrh™s ÿÿ zCookieJar.clearcCsN|j ¡z2|D]}|jr| |j|j|j¡qW|j ¡n |j ¡0dS)z»Discard all session cookies. Note that the .save() method won't save session cookies anyway, unless you ask otherwise by passing a true ignore_discard argument. N)rKr]rÔrhr‘r’r|r^)rÚrõrrrÚclear_session_cookies´s  zCookieJar.clear_session_cookiescCsZ|j ¡z>t ¡}|D]"}| |¡r| |j|j|j¡qW|j ¡n |j ¡0dS)a”Discard all expired cookies. You probably don't need to call this method: expired cookies are never sent back to the server (provided you're using DefaultCookiePolicy), this method is called by CookieJar itself every so often, and the .save() method won't save expired cookies anyway (unless you ask otherwise by passing a true ignore_expires argument). N) rKr]rNrærhr‘r’r|r^)rÚrårõrrrr_Ãs  zCookieJar.clear_expired_cookiescCs t|jƒSrÝ)rArLr rrrÚ__iter__ÖszCookieJar.__iter__cCsd}|D] }|d}q|S)z#Return number of contained cookies.r r r)rÚr¬rõrrrÚ__len__ÙszCookieJar.__len__cCs2g}|D]}| t|ƒ¡qd|jjd |¡fS©Nz<%s[%s]>rƒ)rvrërìrír…©rÚÚrrõrrrrîßszCookieJar.__repr__cCs2g}|D]}| t|ƒ¡qd|jjd |¡fSr|)rvrprìrír…r}rrrréäszCookieJar.__str__)N)NNN)"rírïrðrñrxÚcompilerXrYZstrict_domain_reZ domain_reZdots_reÚASCIIÚmagic_rerÜrOrQrSr[r\rfrkrlrmrsrurtrxrhryr_rzr{rîrérrrrrÛs8      ;!a\  7   rc@s eZdZdS)rNrFrrrrrërGrc@s8eZdZdZd dd„Zd dd„Zddd „Zdd d „ZdS)rz6CookieJar that can be loaded from and saved to a file.NFcCs2t ||¡|durt |¡}||_t|ƒ|_dS)z} Cookies are NOT loaded from the named file until either the .load() or .revert() method is called. N)rrÜÚosÚfspathÚfilenamergÚ delayload)rÚr„r…rNrrrrÜðs   zFileCookieJar.__init__cCs tƒ‚dS)zSave cookies to a file.Nrò)rÚr„Úignore_discardÚignore_expiresrrrÚsaveüszFileCookieJar.savecCs^|dur"|jdur|j}nttƒ‚t|ƒ� }| ||||¡Wdƒn1sP0YdS)zLoad cookies from a file.N)r„rMÚMISSING_FILENAME_TEXTÚopenÚ _really_load©rÚr„r†r‡rrrrÚloads  zFileCookieJar.loadcCsŒ|dur"|jdur|j}nttƒ‚|j ¡zNt |j¡}i|_z| |||¡Wnt yl||_‚Yn0W|j  ¡n |j  ¡0dS)zÈClear all cookies and reload cookies from a saved file. Raises LoadError (or OSError) if reversion is not successful; the object's state will not be altered if this happens. N) r„rMr‰rKr]rØÚdeepcopyrLr�ÚOSErrorr^)rÚr„r†r‡Z old_staterrrÚrevert s    zFileCookieJar.revert)NFN)NFF)NFF)NFF)rírïrðrñrÜrˆr�r�rrrrrís  ÿrcCs |j|jfd|jfd|jfg}|jdur8| d|jf¡|jrH| d¡|jrX| d¡|jrh| d¡|j rx| d¡|j r–| d t t |j ƒƒf¡|j r¦| d ¡|jr¼| d |jf¡|jrÒ| d |jf¡t|j ¡ƒ}|D]}| |t|j|ƒf¡qä| d t|jƒf¡t|gƒS)z�Return string representation of Cookie in the LWP cookie file format. Actually, the format is extended a bit -- see module docstring. r’r‘Nr•)Ú path_specN)Ú port_specN)Ú domain_dotN)r“Nr�)rÔNrÕr`r”)r|r}r’r‘r•rvrÓrÐrÒr“r�r6r]rÔrÕrÖr;rÙr<rpr”rŠ)rõrÌr<rˆrrrÚlwp_cookie_str$s( þ  ÿr”c@s,eZdZdZd dd„Zd dd„Zd d „ZdS) ra[ The LWPCookieJar saves a sequence of "Set-Cookie3" lines. "Set-Cookie3" is the format used by the libwww-perl library, not known to be compatible with any browser, but which is easy to read and doesn't lose information about RFC 2965 cookies. Additional methods as_lwp_str(ignore_discard=True, ignore_expired=True) TcCsTt ¡}g}|D]2}|s |jr q|s0| |¡r0q| dt|ƒ¡qd |dg¡S)zžReturn cookies as a string of "\n"-separated "Set-Cookie3" headers. ignore_discard and ignore_expires: see docstring for FileCookieJar.save zSet-Cookie3: %sÚ rY)rNrÔrærvr”r…)rÚr†r‡rår~rõrrrÚ as_lwp_strMs zLWPCookieJar.as_lwp_strNFcCsl|dur"|jdur|j}nttƒ‚t|dƒ�,}| d¡| | ||¡¡Wdƒn1s^0YdS)NÚwz#LWP-Cookies-2.0 )r„rMr‰rŠÚwriter–rŒrrrrˆ]s   zLWPCookieJar.savecCs,| ¡}|j |¡s$d|}t|ƒ‚t ¡}d}d} d} �z®| ¡} | dkrP�qæ|  |¡s\q<| t|ƒd… ¡} t| gƒD�]f} | d\} }i}i}| D] }d||<q˜| dd…D]n\}}|durÌ|  ¡}nd}|| vsà|| vrä|}|| v�r|durúd }|||<q²|| v�r|||<q²|||<q²|j }|d ƒ}|d ƒ}|du�rJt |ƒ}|du�rXd }|d ƒ}| d ¡}t |dƒ| ||dƒ|dƒ|||dƒ|dƒ|dƒ|dƒ|||dƒ|dƒ|ƒ}|�sÄ|j �rÄqz|�sØ| |¡�rØqz| |¡qzqt�yþ‚Yn*t�y&tƒtd|| fƒ‚Yn0dS)Nz5%r does not look like a Set-Cookie3 (LWP) format filez Set-Cookie3:)r’r‘r“r“rÔ)r”r•r’r‘r�rÕr`rYr Fr Tr�rÔr‘r¥r”r•r’r“r’r‘r“rÕr`z&invalid Set-Cookie3 format file %r: %r)Úreadliner�rArrNrwr)rœr~rLràrgrrÔrærtr�rpr)rÚrr„r†r‡ÚmagicrråÚheaderrcrdÚlineÚdatar|r}rerÛrˆr‰r£rÌr�rÔr‘rÑrvrrrr‹is„ ÿ                  ÷ ÿzLWPCookieJar._really_load)TT)NFF)rírïrðrñr–rˆr‹rrrrr@s  rc@s0eZdZdZe d¡ZdZdd„Zd dd „Z dS) ra’ WARNING: you may want to backup your browser's cookies file if you use this class to save cookies. I *think* it works, but there have been bugs in the past! This class differs from CookieJar only in the format it uses to save and load cookies to and from a file. This class uses the Mozilla/Netscape `cookies.txt' format. lynx uses this file format, too. Don't expect cookies saved while the browser is running to be noticed by the browser (in fact, Mozilla on unix will overwrite your saved cookies if you change them on disk while it's running; on Windows, you probably can't save at all while the browser is running). Note that the Mozilla/Netscape format will downgrade RFC2965 cookies to Netscape cookies on saving. In particular, the cookie version and port number information is lost, together with information about whether or not Path, Port and Discard were specified by the Set-Cookie2 (or Set-Cookie) header, and whether or not the domain as set in the HTTP header started with a dot (yes, I'm aware some domains in Netscape files start with a dot and some don't -- trust me, you really don't want to know any more about this). Note that though Mozilla and Netscape use the same format, they use slightly different headers. The class saves cookies using the Netscape header by default (Mozilla can cope with that). z#( Netscape)? HTTP Cookie Filezr# Netscape HTTP Cookie File # http://curl.haxx.se/rfc/cookie_spec.html # This is a generated file! Do not edit. cCspt ¡}| ¡}|j |¡s(td|ƒ‚�z| ¡}|dkr@�q*| d¡rV|dd…}| ¡ d¡s,| ¡dkrrq,| d¡\}} } } } } }| dk} | dk} | dkrª|} d}| d¡}| |ksÀJ‚d }| dkrÔd} d }t d | |dd || || d | | |ddiƒ}|�s |j �r q,|�s|  |¡�rq,|  |¡q,Wn>t �yB‚Yn*t�yjtƒtd ||fƒ‚Yn0dS) Nz4%r does not look like a Netscape format cookies filerYr•rŒ)ú#rú ÚTRUEr¥FTr z+invalid Netscape format cookies file %r: %r)rNr™r�rArr�rœrwr›rrÔrærtr�rpr)rÚrr„r†r‡råršrœr‘rÑr’r“r�r|r}r¯rÔrvrrrr‹ßsh ÿÿ  ÿÿ  ÷ ÿzMozillaCookieJar._really_loadNFc Cs|dur"|jdur|j}nttƒ‚t|dƒ�Ò}| |j¡t ¡}|D]¨}|sV|jrVqF|sf| |¡rfqF|j rrd}nd}|j   d¡rˆd}nd}|j dur¢t |j ƒ} nd} |jdur¼d} |j} n |j} |j} | d |j ||j|| | | g¡d¡qFWdƒn1�s0YdS)Nr—r ÚFALSEr¥rYrŸr•)r„rMr‰rŠr˜r›rNrÔrær“r‘rwr�rpr}r|r…r’) rÚr„r†r‡rrårõr“r¯r�r|r}rrrrˆ s<       ÿþÿzMozillaCookieJar.save)NFF) rírïrðrñrxrr�r›r‹rˆrrrrr¸s  Ar)N)N)XrñÚ__all__r‚rØr.rxrNÚ urllib.parser²Zurllib.requestÚ threadingrIZ http.clientÚhttpZcalendarr r r rrpÚclientZ HTTP_PORTrÅr‰rr&r-r7r8rJr)rvrLr6r9r?rr€r@rGrVr[ÚIr_ÚXrardrergrmrqrrrtrsr~r„rŠr�r¤r§r¨r­r®r°rµr¹r¾rÃrÆrÉrÊrÇrÁrÎrÏrrrr>rArErr�rrr”rrrrrrÚs²    8þ ÿ ì8 ï!    U D'    #b!b7x