python (3.11.7)

(root)/
lib/
python3.11/
http/
__pycache__/
cookiejar.cpython-311.opt-1.pyc

e.dZgdZddlZddlZddlZddlZddlZddlZddl	Zddl
ZddlZ
ddlmZdZdadZdZdZee
jjZejd	Zd
ZdZdZd
ZdZgdZ gdZ!de!DZ"dLdZ#dLdZ$dddddZ%ejdej&Z'dZ(dZ)ejdej&Z*ejdej+ej&zZ,ejdej-ej&zZ.dZ/ejdej-ej&zZ0dZ1dZ2ejdZ3ejd Z4ejd!Z5ejd"Z6d#Z7ejd$Z8d%Z9d&Z:d'Z;ejd(ej&Z<d)Z=d*Z>d+Z?d,Z@ejd-ej&ZAd.ZBd/ZCd0ZDd1ZEd2ZFejd3ZGd4ZHd5ZId6ZJd7ZKGd8d9ZLGd:d;ZMGd<d=eMZNd>ZOGd?d@ZPGdAdBZQGdCdDeRZSGdEdFeQZTdGZUGdHdIeTZVGdJdKeTZWdS)MaHTTP 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CookiePolicyDefaultCookiePolicy
FileCookieJarLWPCookieJar	LoadErrorMozillaCookieJarN)timegmFcptsdStsddl}|datj|S)Nr
zhttp.cookiejar)debugloggerlogging	getLogger)argsrs  B/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/http/cookiejar.py_debugr,sA5""#344<HTTPOnlyz
#HttpOnly_z#( Netscape)? HTTP Cookie FilezQa filename was not supplied (nor was the CookieJar instance initialised with one)zr# Netscape HTTP Cookie File
# http://curl.haxx.se/rfc/cookie_spec.html
# This is a generated file!  Do not edit.

cddl}ddl}ddl}|}|d||}|d|zddS)Nr
zhttp.cookiejar bug!
%s)
stacklevel)iowarnings	tracebackStringIO	print_excgetvaluewarn)rrrfmsgs     r_warn_unhandled_exceptionr"Bsz#"""""""""""


A
a   
**,,CMM+c1aM@@@@@ric|dd\}}}}}}|tkr_d|cxkrdkrRnnOd|cxkrdkrBnn?d|cxkrdkr2nn/d|cxkrdkr"nnd|cxkrdkrnnt|SdS)	Nr
;=)
EPOCH_YEARr)ttyearmonthmdayhourminsecs       r_timegmr3Qs(*2A2%D%tS#	
		!u"2"2"2"2"2"2"2"2"2db	
dbqC~~~~2~~~~~ANNNNNNNNNbzztr)MonTueWedThuFriSatSun)JanFebMarAprMayJunJulAugSepOctNovDecc6g|]}|S)lower).0r.s  r
<listcomp>rK\s 222%

222rc|tj}ntj|}d|j|j|j|j|j|jfzS)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)	datetimeutcnowutcfromtimestampr-r.dayr0minutesecondtdts  r	time2isozrV^sc	y


%
%
'
'


/
/
2
2+
2627BIry/BBBrc,|tj}ntj|}dt||jt|jdz
|j|j	|j
|jfzS)zReturn 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%)rMrNrODAYSweekdayrPMONTHSr.r-r0rQrRrSs  r
time2netscaper[qsy	y


%
%
'
'


/
/
2
20RZZ\\BFF28A:$6
")RY4000r)GMTUTCUTZz^([-+])?(\d\d?):?(\d\d)?$cVd}|tvrd}nt|}|r~dt|dz}|dr(|dt|dzz}|ddkr|}|S)Nr
ir<r%-)	UTC_ZONESTIMEZONE_REsearchintgroup)tzoffsetms   roffset_from_tz_stringrls
F	Yr""	!C

OO+Fwwqzz
7"s1771::"66wwqzzS   Mrc	.t|}|tjkrdS	t|dz}nI#t$r<	t|}n#t$rYYdSwxYwd|cxkrdkrnn|}nYdSYnwxYw|d}|d}|d}t|}t|}t|}t|}|dkrctjtjd}|dz}	|}
||z|	z
}|	|
z
}	t|	dkr|	dkr|dz}n|dz
}t|||||||f}|0|d}|}t|}|dS||z
}|S)Nr%r&r
id2r])
rgrMMAXYEARMONTHS_LOWERindexrI
ValueErrortime	localtimeabsr3upperrl)
rPmonyrhrr1r2riimoncur_yrrktmprTrjs
             r	_str2timer~s	RB	Ht  --a/				s88DD			444	?????????CC44
C	
z2
{!C
{!C

c((C	RB

c((C

c((C	Dyy	,,Q/SL
&[1_
Gq66B;;1uu28bbCx"	S#r3R011A}
:B
XXZZ&r**>4
JHs5/A
BA.-B.
A=8B<A==BBzV^[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	t|}|r|}t|ddz}t
|d|t
|dt
|dt
|dt|df}t|S|	}td|d}dgd	z\}}}}}}	}
t|}||\}}}}}}	}
ndSt||||||	|
S)
aReturns 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
raN)STRICT_DATE_RErfgroupsrqrrrIrgfloatr3lstrip
WEEKDAY_REsubLOOSE_HTTP_DATE_REr~)textrkgrxr,rPryrzr1r2ris           r	http2timers:<	d##A
HHJJ  1..2!A$iic!A$ii!A$iiQqTE!A$KK1r{{
;;==D>>"dA&&D'+VAX"Cb"c3	!!$''A})*&S"b#sBBtS#r2sC444ra^
    (\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	|}dgdz\}}}}}}}t|}||\}}}}}}}}	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

    Nr)rISO_DATE_RErfrr~)
rrPrxryrzr1r2rirk_s
          riso2timer2s;;==D'+VAX"Cb"c3	4  A}-.HHJJ)Cb#sBtS#r2sC444rcp|d\}}|jd||j|dzS)z)Return unmatched part of re.Match object.r
N)spanstring)matchstartends   r	unmatchedrSs6AJE3<STT 222rz^\s*([^=\s;,]+)z&^\s*=\s*\"([^\"\\]*(?:\\.[^\"\\]*)*)\"z^\s*=\s*([^\s;,]*)z\\(.)c`g}|D]}|}g}|rt|}|rt|}|d}t|}|r@t|}|d}t
d|}nWt|}|r9t|}|d}|}nd}|	||fnx|
dr6|
dd}|r|	|g}ntj
dd|\}}	|}||r|	||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*<any CHAR except CTLs or separators>
      separators        = "(" | ")" | "<" | ">" | "@"
                        | "," | ";" | ":" | "\" | <">
                        | "/" | "[" | "]" | "?" | "="
                        | "{" | "}" | SP | HT

      quoted-string     = ( <"> *(qdtext | quoted-pair ) <"> )
      qdtext            = <any TEXT except <">>
      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;]*r)HEADER_TOKEN_RErfrrhHEADER_QUOTED_VALUE_REHEADER_ESCAPE_RErHEADER_VALUE_RErstripappendr
startswithresubn)

header_valuesresultr	orig_textpairsrknamevaluenon_junk
nr_junk_charss
          rsplit_header_wordsr\s\F#'#'		 &&t,,A
  ||wwqzz*11$77%$Q<<DGGAJJE,00>>EE'..t44A%(|| !

 %!%dE]++++))#..
 {{}}QRR(.&--...+-'+r4*H*H'- ?	 @&&--&&&Mr([\"\\])cHg}|D]}g}|D]X\}}|<tjd|s td|}d|z}|d|}||Y|r(|d|d|S)aDo 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"=; , )rrfHEADER_JOIN_ESCAPE_RErrjoin)listsheadersrattrkvs      rjoin_header_wordsrsG	1	1		DAq}y1--#-11'1==A
A qq!!$KKNNNN0		$00099Wrc|dr
|dd}|dr
|dd}|S)N"r%)rendswithrs rstrip_quotesrsIsABBx}}SCRCyKrcd}g}|D]6}g}d}t|dD]\}}|}|d\}}	}
|}|s	|dkrnQ|	r|
nd}
|dkrX|}||vr|}|dkr|
t|
}
d}n$|d	kr|
t
t|
}
|||
f|r,|s|d
||8|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.

    )expiresdomainpathsecureversionportmax-ageF;rr
NrTr)r0)	enumeratesplitstrip	partitionrIrrr)
ns_headersknown_attrsr	ns_headerrversion_setiiparamkeysepvallcs            rparse_ns_headersrsw1KF+!+!	#9??3#7#788	%	%IBKKMME!OOC00MCc))++C
77E"%.#))+++$CQwwYY[[$$C)##*3//"&KKI%%'S(9(9::LL#s$$$$	!
/-...MM%   Mrz\.\d+$ct|rdS|dkrdS|ddks|ddkrdSdS)z*Return True if text is a host domain name.Frr
.rTIPV4_RErfrs ris_HDNrsN~~durzzuAw#~~bSu4rc.|}|}||krdSt|sdS||}|dks|dkrdS|dsdSt|ddsdSdS)aReturn 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.

    TFrr
rr%N)rIrrfindr)ABis   rdomain_matchr&s.	
		A			AAvvt!99u	

ABww!q&&u<<u!ABB%==u4rc>t|rdSdS)zdReturn True if text is a sort-of-like a host domain name.

    For accepting/blocking domains.

    FTrrs rliberal_is_HDNrMs"~~du4rc|}|}t|rt|s
||krdSdS|d}|r||rdS|s||krdSdS)z\For blocking/accepting domains.

    A and B may be host domain names or IP addresses.

    TFr)rIrrr)rrinitial_dots   ruser_domain_matchrWs	
		A			A1."3"3664u,,s##Kqzz!}}t166t5rz:\d+$c|}tj|d}|dkr|dd}t
d|d}|S)zReturn request-host, as defined by RFC 2965.

    Variation from RFC: returned value is lowercased, for convenient
    comparison.

    r%rHost)get_full_urlurllibparseurlparse
get_headercut_port_rerrI)requesturlhosts   rrequest_hostrlsr


 
 C<  %%a(Drzz!!&"--??2tQ''D::<<rct|x}}|ddkrt|s|dz}||fS)zzReturn a tuple (request-host, effective request-host name).

    As defined by RFC 2965, except both are lowercased.

    rr.local)rfindrrf)rerhnreq_hosts   reff_request_hostr|sR#7+++D8}}SRx(@(@("T>rc|}tj|}t	|j}|dsd|z}|S)z6Path component of request-URI, as defined by RFC 2965./)rrrurlsplitescape_pathrr)rrpartsrs    rrequest_pathrsY



 
 CL!!#&&Euz""D??3TzKrc|j}|d}|dkr?||dzd}	t|n(#t$rt	d|YdSwxYwt
}|S)N:r
r%znonnumeric port: '%s')rrrgrsrDEFAULT_HTTP_PORT)rrrrs    rrequest_portrs<D		#AAvvAaCDDz	IIII			*D11144	!KsAAAz%/;:@&=+$,!~*'()z%([0-9a-fA-F][0-9a-fA-F])cVd|dzS)Nz%%%sr%)rhrw)rs ruppercase_escaped_charrs#EKKNN((****rctj|t}tt|}|S)zEEscape any invalid characters in HTTP URL, and uppercase all escapes.)rrquoteHTTP_PATH_SAFEESCAPED_CHAR_RErr)rs rrrs6<dN33D5t<<DKrc|d}|dkrB||dzd}|d}t|r|dks|dkrd|zS|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'

    rr
r%Nlocal)rr)hrbs   rreachrsh4	
sAAvv
acddG
FF3KK!99	!q&&ALLq5LHrclt|}t|t|jsdSdS)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.

    TF)rrrorigin_req_host)rrs  ris_third_partyrs8G$$H%(?"@"@AAturcDeZdZdZ	ddZdZddZdZddZd	Z	d
Z
dS)
raHTTP 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.

    Fc|t|}|tt|}||durtd||_||_||_||_||_||_	||_
||_|	|_|
|_
||_||_|
|_||_||_||_t)j||_dS)NTz-if port is None, port_specified must be false)rgrrsrrrrport_specifiedrIrdomain_specifieddomain_initial_dotrpath_specifiedrrdiscardcommentcomment_urlrfc2109copy_rest)selfrrrrrrrrrrrrrrrrestrs                  r__init__zCookie.__init__s#g,,#eGnn*=*=<Nd22LMMM	
	,llnn 0
#5	,&Yt__


rc||jvSNr)r rs  rhas_nonstandard_attrzCookie.has_nonstandard_attr#stz!!rNc8|j||Sr$)rget)r rdefaults   rget_nonstandard_attrzCookie.get_nonstandard_attr%sz~~dG,,,rc||j|<dSr$r%)r rrs   rset_nonstandard_attrzCookie.set_nonstandard_attr's 
4rcX|tj}|j
|j|krdSdSNTF)rtr)r nows  r
is_expiredzCookie.is_expired*s/;dikkL$4<3+>+>4urc|jd}n
d|jz}|j|z|jz}|j|jd|j}n|j}d|d|dS)Nrrrz<Cookie z for >)rrrrr)r plimit	namevalues    r__str__zCookie.__str__0sf9"aadi-aa$)+:!#'999djj9II	I'0yy%%%88rcpg}dD]9}t||}||dt|:|dt|jz|dt|jz|jjdd|dS)N)rrrrrrrrrrrrrrrrzrest=%sz
rfc2109=%s(r))getattrrreprrr	__class____name__r)r rrrs    r__repr__zCookie.__repr__:s	6	6D4&&DKK444d45555ITZ 0 00111L4#5#55666>222DIIdOOOODDr)Fr$)r=
__module____qualname____doc__r"r&r*r,r0r6r>rHrrrrs6(%(%(%(%T"""----!!!999EEEEErrc*eZdZdZdZdZdZdZdS)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.

    ct)zReturn 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.

        NotImplementedErrorr cookiers   rset_okzCookiePolicy.set_okRs"###rct)zAReturn true if (and only if) cookie should be returned to server.rDrFs   r	return_okzCookiePolicy.return_ok[!###rcdS)zMReturn false if cookies should not be returned, given cookie domain.
        TrH)r rrs   rdomain_return_okzCookiePolicy.domain_return_ok_	trcdS)zKReturn false if cookies should not be returned, given cookie path.
        TrH)r rrs   rpath_return_okzCookiePolicy.path_return_okdrNrN)r=r?r@rArHrJrMrPrHrrrrIsZ$$$$$$
rrc
eZdZdZdZdZdZdZeezZdddddddddeddd	f
d
Z	dZ
dZd
ZdZ
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd ZdS)!rzBImplements the standard rules for accepting and returning cookies.r%rrr
NTF)httpswssc||_||_||_||_||_||_|	|_|
|_||_||_	|
|_
|t||_nd|_|t|}||_
dS)zAConstructor arguments should be passed as keyword arguments only.NrH)netscaperfc2965rfc2109_as_netscapehide_cookie2
strict_domainstrict_rfc2965_unverifiablestrict_ns_unverifiablestrict_ns_domainstrict_ns_set_initial_dollarstrict_ns_set_pathsecure_protocolstuple_blocked_domains_allowed_domains)r blocked_domainsallowed_domainsrUrVrWrXrYrZr[r\r]r^r_s              rr"zDefaultCookiePolicy.__init__ts!
#6 (*+F(&<# 0,H)"4 0&$)/$:$:D!!$&D!&#O44O /rc|jS)z4Return the sequence of blocked domains (as a tuple).)rar s rrcz#DefaultCookiePolicy.blocked_domains$$rc.t||_dS)z$Set the sequence of blocked domains.N)r`ra)r rcs  rset_blocked_domainsz'DefaultCookiePolicy.set_blocked_domainss %o 6 6rc@|jD]}t||rdSdSr.)rar)r rblocked_domains   r
is_blockedzDefaultCookiePolicy.is_blockeds7"3		N 88
tt
urc|jS)z=Return None, or the sequence of allowed domains (as a tuple).)rbrfs rrdz#DefaultCookiePolicy.allowed_domainsrgrc6|t|}||_dS)z-Set the sequence of allowed domains, or None.N)r`rb)r rds  rset_allowed_domainsz'DefaultCookiePolicy.set_allowed_domainss#&#O44O /rcR|jdS|jD]}t||rdSdS)NFT)rbr)r rallowed_domains   ris_not_allowedz"DefaultCookiePolicy.is_not_allowedsE (5"3		N 88
uu
trctd|j|jdD]&}d|z}t||}|||sdS'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=%s)r
verifiabilityrrrrset_ok_FTrrrr:r rGrnfn_namefns      rrHzDefaultCookiePolicy.set_oksl	)6;EEEN		AkGw''B2fg&&
uu
trc|jtd|j|jdS|jdkr|jstddS|jdkr|jstddSdS)Nz0   Set-Cookie2 without version attribute (%s=%s)Fr
$   RFC 2965 cookies are switched off$   Netscape cookies are switched offT)rrrrrVrUrFs   rset_ok_versionz"DefaultCookiePolicy.set_ok_versions>!
E;
.
.
.5>Adl9:::5
^q
 
 
 9:::5trc|jrUt|rF|jdkr|jrt	ddS|jdkr|jrt	ddSdSNr
z>   third-party RFC 2965 cookie during unverifiable transactionFz>   third-party Netscape cookie during unverifiable transactionTunverifiablerrrZrr[rFs   rset_ok_verifiabilityz(DefaultCookiePolicy.set_ok_verifiabilitys	N7$;$;	~!!d&F!8999u1$$)D$8999utrc|jdkr8|jr1|jdrt	d|jdSdS)Nr
$z'   illegal name (starts with '$'): '%s'FT)rr]rrrrFs   rset_ok_namezDefaultCookiePolicy.set_ok_namesN
NaD$EK""3''
 <fkJJJ5trc|jr_t|}|jdks|jdkr:|jr3||j|st
d|j|dSdS)Nr
z7   path attribute %s is not a prefix of request path %sFT)rrrr^rPrr)r rGrreq_paths    rset_ok_pathzDefaultCookiePolicy.set_ok_paths~ 	#G,,H!##.A%%$*A%''W==&!"(+x999utrc|||jrtd|jdS||jrtd|jdS|jrQt|\}}|j}|jr|ddkr|d}|dd|}|dkrU||dzd}||dz|}	|		dvr%t|dkrtd	|dS|dr|dd}
n|}
|
ddk}|s'|
d
std|dS|jdkrm|
|sX|
|
d
s@|ds+d|z
|std||dS|jdks|j|jzr#t#||std
||dS|jdks|j|jzr^|dt|}|ddkr-t&|std||dSdS)N"   domain %s is in user block-listF&   domain %s is not in user allow-listrrr
r%)coaccomeduorgnetgovmilrgaerobizcatcoopinfojobsmobimuseumrprotraveleuz&   country-code second level domain %srz/   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)rlrrrrrrrYcountrrIlenrrrrr\DomainRFC2965MatchrDomainStrictNoDotsrrf)
r rGrrrrrjtldsldundotted_domain
embedded_dotshost_prefixs
             r
set_ok_domainz!DefaultCookiePolicy.set_ok_domains??6=))	7GGG5v}--	;V]KKK5"2	!-g66NHd]F!
%v||C'8'8A'='=LL%%LLa++66 1,C 1Q-Cyy{{'''',/s88q==GPPP$u  %%
)"(*"(,11#66!;M 
x)@)@
Hu~""v..!/'A'A'ABB!--!d(,,V44!?)))!5""&)@@##D&11! !%v/// 5""&)@@#&}V}5$$S))Q..x00/K&000 5trc:|jrt|}|d}nt|}|jdD]=}	t|n"#t$rtd|YdSwxYw||krn>td||jdSdS)N80rz   bad port %s (not numeric)Fz$   request port (%s) not found in %sT)rrstrrrrgrsrr rGrreq_portr3s     rset_ok_portzDefaultCookiePolicy.set_ok_port3s 	#G,,Hx==[&&s++

!FFFF!!!!91=== 555!==E!=...utsAA76A7ctd|j|jdD]&}d|z}t||}|||sdS'dS)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).

        rt)rrurrrr
return_ok_FTrwrxs      rrJzDefaultCookiePolicy.return_okHsg	)6;EEER		A"1nGw''B2fg&&
uu
trc|jdkr|jstddS|jdkr|jstddSdS)Nr
r}Fr~T)rrVrrUrFs   rreturn_ok_versionz%DefaultCookiePolicy.return_ok_versionZsW>Adl9:::5
^q
 
 
 9:::5trc|jrUt|rF|jdkr|jrt	ddS|jdkr|jrt	ddSdSrrrFs   rreturn_ok_verifiabilityz+DefaultCookiePolicy.return_ok_verifiabilitycs	N7$;$;	~!!d&F!%&&&u1$$)D$%&&&utrcR|jr|j|jvrtddSdS)Nz(   secure cookie with non-secure requestFT)rtyper_rrFs   rreturn_ok_securez$DefaultCookiePolicy.return_ok_secureos4=	W\1FFF=>>>5trc\||jrtddSdS)Nz   cookie expiredFT)r0_nowrrFs   rreturn_ok_expiresz%DefaultCookiePolicy.return_ok_expiresus3TY''	&'''5trc|jrPt|}|d}|jdD]
}||krntd||jdSdS)Nrrz0   request port %s does not match cookie port %sFT)rrrrrs     rreturn_ok_portz"DefaultCookiePolicy.return_ok_port{s~;
	#G,,H[&&s++

==E!I...utrct|\}}|j}|r|dsd|z}n|}|jdkr-|j|jzr|js||krtddS|jdkr#t||std||dS|jdkr+d|z	|std||dSdS)Nrr
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)
rrrrr\DomainStrictNonDomainrrrr)r rGrrrr	dotdomains       rreturn_ok_domainz$DefaultCookiePolicy.return_ok_domains )'22$	&++C00	fIII
Na

"T%?
?
 '
 ,2dNN-
.
.
.5>Al4&@&@/04f
>
>
>5>QD':':9'E'E!6
+
+
+5trct|\}}|dsd|z}|dsd|z}|r|dsd|z}n|}||s||sdS||rt	d|dS||rt	d|dSdS)NrFrrT)rrrrlrrr)r rrrrrs      rrMz$DefaultCookiePolicy.domain_return_oks	*'22$""3''	$8|Hs##	t8D	&++C00	fIII!!),,	

i0H0H	5??6""	7@@@5v&&	;VDDD5trctd|t|}t|}||krdS||r(|ds|||dzdkrdStd||dS)Nz- checking cookie path=%sTrr%z  %s does not path-match %sF)rrrrr)r rrrpathlens     rrPz"DefaultCookiePolicy.path_return_oks*D111((d))t4!!$''	}}S!!	%-ggai.?%@C%G%G4,h===ur) r=r?r@rArrr
DomainLiberalDomainStrictr"rcrirlrdrorrrHrrrrrrrJrrrrrrrMrPrHrrrrjsLLM%&;;L"&t%)#$-1(-"/.3$)"2!0!0!0!0F%%%777%%%000&





			:::x*$


64rrc#Kt|D]:}d}	|jd}t|Ed{Vn#t$rYnwxYw|s|V;dS)z)Iterates over nested mapping, depth-firstFTN)listvaluesitems
deepvaluesAttributeError)mappingobjs  rrrsGNN$$%%

	'IIG!#&&&&&&&&				D	
	III

sA
AAceZdZdS)AbsentNr=r?r@rHrrrrrrc`eZdZdZejdZejdZejdZejdZ	ejdZ
ejdejZdd	Z
d
ZdZdZd
ZdZdZdZdZdZdZdZdZdZddZdZdZdZdZdZ dZ!dS) rzCollection 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+)Ncr|t}||_tj|_i|_dSr$)r_policy
_threadingRLock
_cookies_lock_cookiesr policys  rr"zCookieJar.__init__s5>(**F'-//


rc||_dSr$)rrs  r
set_policyzCookieJar.set_policys
rcg}|j||sgStd||j|}|D]}|j||s||}|D]Q}|j||std-td||R|S)Nz!Checking %s for cookies to returnz   not returning cookiez   it's a match)	rrMrrkeysrPrrJr)r rrcookiescookies_by_pathrcookies_by_namerGs        r_cookies_for_domainzCookieJar._cookies_for_domains|,,VW==	I2F;;;-/#((**		'		'D<..tW==
-d3O)0022
'
'|--fg>>4555()))v&&&&
'rcg}|jD]+}||||,|S)z2Return a list of cookies to be returned to server.)rrextendr)r rrrs    r_cookies_for_requestzCookieJar._cookies_for_request
sPm((**	F	FFNN433FGDDEEEErc>|ddd}g}|D]|}|j}|s d}|dkr|d|z|jF|j|jr'|dkr!|jd|j}n|j}|j||jn||jd	||dkr|j	r|d
|j
z|jdrE|j}|j
s|dr
|dd}|d
|z|j+d}|jr
|d|jzz}||~|S)zReturn 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).

        c*t|jSr$)rr)as r<lambda>z)CookieJar._cookie_attrs.<locals>.<lambda>s3qv;;rT)rreverseFr
z$Version=%sNrrz
$Path="%s"rr%z$Domain="%s"z$Portz="%s")sortrrrnon_word_rerfquote_rerrrrrrrrr)	r rrattrsrGrrrr3s	         r
_cookie_attrszCookieJar._cookie_attrss	..===(	$(	$FnG
:"Q;;LL!8999
) ''55*:AA++
))'6<@@|#V[))))UU;<<<{{(=LL!;<<<=++C00:#]F"5,))#..,!'LL&!8999;*A,86;!67LLOOOrctd|j	tt	jx|j_|_||}||}|r>|	ds)|
dd||jjrI|jj
s=|	ds(|D]%}|jdkr|
ddn&|jn#|jwxYw|dS)zAdd correct Cookie: header to request (urllib.request.Request object).

        The Cookie2 header is also added unless policy.hide_cookie2 is true.

        add_cookie_headerrrCookie2r%z$Version="1"N)rracquirergrtrrrr
has_headeradd_unredirected_headerrrVrXrreleaseclear_expired_cookies)r rrrrGs     rrzCookieJar.add_cookie_headerLss	"###""$$$	),/	,<,<<DL	//88G&&w//E
4))(33433 $))E"2"2444$
T\-F
&&y11
%F~**77	>RRR+

&&((((D&&((((""$$$$$sC0D44Ecvg}d}d}|D].}|d\}}d}d}	i}
i}|ddD]\}}
|}||vs||vr|}||vr|
d}
||
vr0|dkr)|
td	d}	n|
}
|d
kr|rh|
tdz|dkrAd}	t|
}
n"#t$rtd
d}	Yn@wxYwd
}|j|
z}
||vs||vr"|
|dvrtd|zd}	n|
|
|<|
||<|	r||||
|f0|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.

        )rr)rrrrrrr
commenturlr
Fr%NTrz%   missing value for domain attributerzM   missing or invalid value for expires attribute: treating as session cookierz?   missing or invalid (non-numeric) value for max-age attribute)rrrz!   missing value for %s attribute)rIrrgrsrr)r 	attrs_set
cookie_tuples
boolean_attrsvalue_attrscookie_attrsrrmax_age_set
bad_cookiestandardr!rrrs               r_normalized_cookie_tuplesz#CookieJar._normalized_cookie_tuplesms
+
0
&H	@H	@L&q/KD% KJHD$QRR(2
 2
 1WWYY$$m(;(;A
%%!)A====yFGGG%)
		A	>>"! y FGGG 	>>"&KFF% 2333%)
	"A	A
A$$!}*<*<	!BBBBQFGGG%)
"#HQKKDGG
  $x!>????s,B<<CCc2|\}}}}|dt}|dt}|dt}	|dt}
|dd}|"	t|}n#t$rYdSwxYw|dd}|dd}
|d	d}|d
d}|tur|dkrd}t	|}n_d}t|}|d
}|dkr|dkr|d|}n
|d|dz}t|dkrd
}|tu}d}|r"t|	d}|turt|\}}|}n|	dsd|z}d}|	tur+|	t|}	nd}tj
dd|	}	nd}	|
turd}
d}
nH|
|jkr=	||||n#t $rYnwxYwt#d|||dSt%||||	||||||||
|
|||S)NrrrrrrFrrrrTrrr
r%rz\s+z2Expiring cookie, domain='%s', path='%s', name='%s')r(rrgrsrrrrboolrrrrrrclearKeyErrorrr)r tuprrrrr!rrrrrrrrrrrrrrrrs                       r_cookie_from_cookie_tuplez#CookieJar._cookie_from_cookie_tuples
'*#eXth//||FF++||FF++,,y&11,,y$//
g,,


tt
h..,,y%00,,y$//ll<66v$"**!Nt$$DD"N((D

3ABwwa<<8DD1:D4yyA~~ct"/"	>!%f&7&7&<&<!=!=V-g66NHdFF""3''	 ZFv|$G,,!%vfb$//DfGGG
	
!
!


64....



G4
'
'
'4gEN.0BN!


	s$
B
B+*B+?I
I$#I$c||}g}|D]/}|||}|r||0|Sr$)rrr)r rrrrr
rGs       r_cookies_from_attrs_setz!CookieJar._cookies_from_attrs_set*s[66yAA
 	.	.C33CAAF-w~~f---rct|jdd}|
|jj}|D]}|jdkrd|_|rd|_dS)NrWr%Tr
)r:rrVrr)r r
rfc2109_as_nsrGs    r_process_rfc2109_cookiesz"CookieJar._process_rfc2109_cookies3sh.CTJJ
  $ 44M	'	'F~""!% '&'FN
	'	'rc|}|dg}|dg}ttjx|j_|_|jj}|jj}|s|r|s|r|s|r|s|sgS	|t||}n #t$rtg}YnwxYw|r|r	|t||}	n #t$rtg}	YnwxYw|
|	|r3i}
|D]}d|
|j|j|jf<|
fd}t#||	}	|	r||	|S)zAReturn sequence of Cookie objects extracted from response object.zSet-Cookie2z
Set-CookieNc2|j|j|jf}||vSr$)rrr)	ns_cookielookuprs   rno_matching_rfc2965z3CookieJar.make_cookies.<locals>.no_matching_rfc2965ls #*ININJCf,,r)rget_allrgrtrrrVrUr
r	Exceptionr"rrrrrfilterr)
r responserrrfc2965_hdrsns_hdrsrVrUr
ns_cookiesrrGrs
             rmake_cookieszCookieJar.make_cookies?s--//}b99//,33(+DIKK(8(88DI,&<(	g		!(		&.		#*	I	22"<00';;GG			%'''GGG		+x	+
 !99$W--w88


 
 
 )+++



 
))*555
E%MMFHLFFM6;DEE:@----$$7DD

+z***s$#CCC&#D

D'&D'cj|j	ttjx|j_|_|j||r|||jdS#|jwxYw)z-Set a cookie if policy says it's OK to do so.N)	rrrgrtrrrH
set_cookierrFs   rset_cookie_if_okzCookieJar.set_cookie_if_okvs""$$$	),/	,<,<<DL	|""6733
('''
&&(((((D&&((((sA!BB2cJ|j}|j	|j|vr
i||j<||j}|j|vr
i||j<||j}|||j<|jdS#|jwxYw)z?Set a cookie, without checking whether or not it should be set.N)rrrrrrr)r rGcc2c3s     rrzCookieJar.set_cookiesM""$$$	)}A%%"q'76=!B{"$$boFKB$Bv{O&&(((((D&&((((sA
BB"ctd||j	|||D]B}|j||r%td|||C	|jdS#|jwxYw)zAExtract cookies from response, where allowable given the request.zextract_cookies: %sz setting cookie: %sN)	rrrrrrrHrr)r rrrGs    rextract_cookieszCookieJar.extract_cookiess$hmmoo666""$$$	)++Hg>>
,
,<&&vw77,0&999OOF+++
,

&&(((((D&&((((sAB22C
c|)||td|j|||=dS|!|td|j||=dS|
|j|=dSi|_dS)aClear 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)rsr)r rrrs    rrzCookieJar.clearsDL NPPP
f%d+D111

~ DFFF
f%d+++


f%%%DMMMrc|j	|D]/}|jr&||j|j|j0	|jdS#|jwxYw)zDiscard 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)rrrrrrrr)r rGs  rclear_session_cookieszCookieJar.clear_session_cookiess	
""$$$	)
H
H>HJJv}fk6;GGG
H
&&(((((D&&((((s2A))BcP|j	tj}|D]=}||r&||j|j|j>	|jdS#|jwxYw)aDiscard 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)	rrrtr0rrrrr)r r/rGs   rrzCookieJar.clear_expired_cookiess	
""$$$	))++C
H
H$$S))HJJv}fk6;GGG
H
&&(((((D&&((((sAB

B%c*t|jSr$)rrrfs r__iter__zCookieJar.__iter__s$-(((rcd}|D]}|dz}|S)z#Return number of contained cookies.r
r%rH)r rrGs   r__len__zCookieJar.__len__s!
%%FAAArcg}|D]$}|t|%d|jjdd|dSN<[rz]>)rr;r<r=rr rrGs   rr>zCookieJar.__repr__sS22FAHHT&\\22222!^444diillllCCrcg}|D]$}|t|%d|jjdd|dSr0)rrr<r=rr3s   rr6zCookieJar.__str__sS11FAHHS[[11111!^444diillllCCrr$)NNN)"r=r?r@rArcompilerrstrict_domain_re	domain_redots_reASCIImagic_rer"rrrrrrrr
rrr rr&rr)rr,r.r>r6rHrrrrs"*U##Krz+&&H!rz+..
8$$Ibj!!Grz6AAH$999v%%%B___BZZZx
'
'
'555n))))))
)
)
)6
)
)
))))&)))DDD
DDDDDrrceZdZdS)rNrrHrrrrrrrc6eZdZdZddZd	dZd	dZ		d	dZdS)
rz6CookieJar that can be loaded from and saved to a file.NFct|||tj|}||_t||_dS)z}
        Cookies are NOT loaded from the named file until either the .load() or
        .revert() method is called.

        N)rr"osfspathfilenamer	delayload)r rArBrs    rr"zFileCookieJar.__init__sG	4(((y**H 
irct)zSave cookies to a file.rD)r rAignore_discardignore_expiress    rsavezFileCookieJar.saverKrc|#|j|j}nttt|5}|||||ddddS#1swxYwYdS)zLoad cookies from a file.N)rArsMISSING_FILENAME_TEXTopen_really_loadr rArDrEr s     rloadzFileCookieJar.loads}(T](("#8999
(^^	Kqa>>JJJ	K	K	K	K	K	K	K	K	K	K	K	K	K	K	K	K	K	KsAA"Ac|#|j|j}ntt|j	tj|j}i|_	||||n#t$r	||_wxYw	|j
dS#|j
wxYw)zClear 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)rArsrHrrrdeepcopyrrLOSErrorr)r rArDrE	old_states     rrevertzFileCookieJar.reverts}(T](("#8999""$$$	)
dm44IDM
		(NNCCCC


 )

D
&&(((((D&&((((s$ B+!A98B+9BB++C)NFNNFF)r=r?r@rAr"rFrLrQrHrrrrsv@@
)
)
)
)$$$$KKKK#49))))))rrc|j|jfd|jfd|jfg}|j|d|jf|jr|d|jr|d|jr|d|j	r|d|j
r6|d	tt|j
f|j
r|d
|jr|d|jf|jr|d|jft!|j}|D]1}||t'|j|f2|d
t'|jft+|gS)zReturn string representation of Cookie in the LWP cookie file format.

    Actually, the format is extended a bit -- see module docstring.

    rrNr)	path_specN)	port_specN)
domain_dotN)rNr)rNrrr)rrrrrrrrrrrrVrrrrsortedrrrrr)rGrrrs    rlwp_cookie_strrX's+v|	$
&+	
FM	"	$A{&&+)> ? ? ?
;ahh':;;;
;ahh':;;;
 @!((+?"@"@"@
}0ahh/000
~Bqxx(v~)>)>??!ABBB
~2qxx 1222
~<qxxFN ;<<<
G188\63E$FGGG&,##%%&&D
,,	!Sa))*++++HHiV^,,
-...aS!!!rc(eZdZdZddZd	dZdZdS)
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)

    Tctj}g}|D]I}|s|jr|s||r$|dt	|zJd|dgzS)zReturn cookies as a string of "\n"-separated "Set-Cookie3" headers.

        ignore_discard and ignore_expires: see docstring for FileCookieJar.save

        zSet-Cookie3: %s
r)rtrr0rrXr)r rDrEr/r4rGs      r
as_lwp_strzLWPCookieJar.as_lwp_strPsikk	A	AF!
fn
!
f&7&7&<&<

HH&)?)??@@@@yyB4   rNFc|#|j|j}ntttjtj|tjtjztjzdd5}|	d|	|
||ddddS#1swxYwYdS)Nwz#LWP-Cookies-2.0
)rArsrHr?fdopenrIO_CREATO_WRONLYO_TRUNCwriter\rKs     rrFzLWPCookieJar.save`s	}(T](("#8999
YGHbj2;6CUKK

	E
GG()))
GGDOONNCCDDD	E	E	E	E	E	E	E	E	E	E	E	E	E	E	E	E	E	Es3?B??CCc|}|j|sd|z}t|t	j}d}d}	d}
		|}|dkrdS||s3|t
|d}t|gD]f}|d\}
}i}i}|	D]}d||<|ddD]E\}}||	}nd}||
vs||	vr|}||	vr
|d	}|||<6||
vr|||<@|||<F|j
}|d
}|d}|t|}|d	}|d}|d
}t|d|
||d|d|||d|d|d|d|||d|d|}|s	|j
r8|s||rQ||h#t $rt"$r$t%td|d|wxYw)Nz5%r does not look like a Set-Cookie3 (LWP) format filezSet-Cookie3:)rUrTrVrr)rrrrrrrr%rr
FTrrrrrrrUrVrrTrrrz invalid Set-Cookie3 format file : )readliner;rfrrtrrrrrIr(rrrr0rrOrr")r r rArDrEmagicr!r/headerrrlinedatarrrr!rrrrrrrrr"s                          rrJzLWPCookieJar._really_loados%

}##E**	!$%CC.. ikk.
0
;	.4
'zz||2::uuv..CKKLL)//11.v66-'-'D"&q'KD%!HD*,,&+ $QRR((1=!"BB!%B+--23F3F "A
-- yd!*+HQKK+--*+HQKK&'DGG Aa	llGa	llG*"*7"3"3"&Qx[[F'-'8'8'='=$qq||T5 qyy!!K..%'7< qyy!!K.. q{{&& q|| q#	%	%A*!ai! )!all3.?.?! OOA&&&&i4
'j				.	.	.%''')%XXtt-..
.	.sH3:F9H338I+)TTrR)r=r?r@rAr\rFrJrHrrrrCs^

!!!! 
E
E
E
EL.L.L.L.L.rrc eZdZdZdZddZdS)r	a

    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.  curl and lynx use 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).

    ctj}t|st	d|z		|}i}|dkrdS|tr&d|t<|ttd}|	dr
|dd}|
ds|
dkr|d\}}	}
}}}
}|dk}|	dk}	|
dkr|}
d}|d	}d
}|dkrd}d}td|
|dd
||	||
d
|||dd|}|s	|j
r;|s||rT||j#t $rt"$r$t%t	d
|d|wxYw)Nz4%r does not look like a Netscape format cookies filer%rr[r)#r	TRUErFTr
z%invalid Netscape format cookies file rf)rtNETSCAPE_MAGIC_RGXrrgrrHTTPONLY_PREFIX
HTTPONLY_ATTRrrrrrrr0rrOrr")r r rArDrEr/rjr!rrrrrrrrrr"s                  rrJzMozillaCookieJar._really_loadsfikk!''

55	F
?	.7
#zz||2::uu
???337*,D'O 4 4 5 56D==&&8tCRCyJJLL++J77JJLLB&&

4((M($u F*$4$> 2::!D E$//44 b=="G"G1dE!#3[!""	!	!&!)%!,,s*;*;"""o7
#r				.	.	.%''')%XXtt-..
.	.sF>2EF>>8G6NFc
P|#|j|j}ntttjtj|tjtjztjzdd5}|	ttj}|D]}|j}|s|j
r|s||r+|jrd}nd}|drd}	nd}	|jt%|j}
nd}
|j
d}|j}n|j}|j}|t,r
t.|z}|	d||	|j||
||gdz	ddddS#1swxYwYdS)	Nr^r_rpFALSErrror[)rArsrHr?r`rIrarbrcrdNETSCAPE_HEADER_TEXTrtrrr0rrrrrrr&rsrrrr)
r rArDrEr r/rGrrrrrrs
             rrFzMozillaCookieJar.save's}(T](("#8999
YGHbj2;6CUKK

"	
GG())))++C

%&.%&*;*;C*@*@='6&&&f$$S)),;;$+k>-!&.11GG G<'D"KEE!;D"LE..}==6,v5FIIv{FK%we=>>3

"	"	"	"	"	"	"	"	"	"	"	"	"	"	"	"	"	"	s3DFF"FrR)r=r?r@rArJrFrHrrr	r	sE>G.G.G.R''''''rr	r$)XrA__all__r?rrMrrturllib.parserurllib.request	threadingrhttp.clienthttpcalendarrr
rrrsrrrclient	HTTP_PORTrr6rqrHrvr"r+r3rXrZrqrVr[rdr:rerlr~rIrXrrrrrrrrrrrrrrrrrrrrrrrrr
rrrrrrrrrrrrOrrrXrr	rHrr<module>rs6MMM
							########
	

C-..RZ @AA:AAA
988
4
4
4226222BBBB&0000(T==	bj5rx@@6
6
6
p,-/X77RZ2BD28OEE
RZ&
D28O)*656565pbj
 4")#$555B333
$$677#$MNN#$9::2:h''SSSj#
;//2AAAH"*Y
)
)


%%%N(bj28,, 			 $"*9::+++!
!
!
F"_E_E_E_E_E_E_E_EDB_____,___B"LDLDLDLDLDLDLDLD`4)4)4)4)4)I4)4)4)n"""8x.x.x.x.x.=x.x.x.vPPPPP}PPPPPr