Mini Kabibi Habibi

Current Path : C:/Users/ITO/AppData/Local/Programs/Python/Python314/Lib/http/__pycache__/
Upload File :
Current File : C:/Users/ITO/AppData/Local/Programs/Python/Python314/Lib/http/__pycache__/cookiejar.cpython-314.pyc

+
��h7���Rt.RKOt^R	It^R	It^R	It^R	It^R	It^R	It^R	I	t^R	I
t^R	It
^R
IHtRtR	sRtR
tRt]!]
P,P.4t]P2!R4tRtRtRtRtRt.RLOt .RMOt!]!Uu.uFqPE4NK	upt#RNRlt$RNRlt%RR	RR	RR	RR	/t&]P2!R]PN4t(Rt)Rt*]P2!R]PN4t+]P2!R]PX]PN,4t-]P2!R ]P\]PN,4t/R!t0]P2!R"]P\]PN,4t1R#t2R$t3]P2!R%4t4]P2!R&4t5]P2!R'4t6]P2!R(4t7R)t8]P2!R*4t9]P2!R+4t:R,t;R-t<R.t=]P2!R/]PN4t>R0t?R1t@R2tAR3tB]P2!R4]PN4tCR5tDR6tER7tFR8tGR9tH]P2!R:4tIR;tJR<tKR=tLR>tM!R?R4tN!R@R4tO!RAR]O4tPRBtQ!RCRD4tR!RER4tS!RFR]T4tU!RGR]S4tVRHtW!RIR]V4tX!RJR]V4tYR	#uupi)Oa�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�MozillaCookieJarN)�timegmFc��\'gR#\'g^RIpVPR4s\P!V!#)Nzhttp.cookiejar)�debug�logger�logging�	getLogger)�argsrs* �JC:\Users\ITO\AppData\Local\Programs\Python\Python314\Lib\http\cookiejar.py�_debugr,s2���5���6���"�"�#3�4���<�<�����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.

c��^RIp^RIp^RIpVP4pVP	RV4VP4pVP
RV,^R7R#)�Nzhttp.cookiejar bug!
%s)�
stacklevel)�io�warnings�	traceback�StringIO�	print_exc�getvalue�warn)rrr�f�msgs     r�_warn_unhandled_exceptionr!BsF��#�"�
���
�A�
����a� �
�*�*�,�C��M�M�+�c�1�a�M�@ri�c�
�VR,wrr4rVV\8�dk^Tu;8:d^8:d\MR#^Tu;8:d^8:dIMR#^Tu;8:d^8:d6MR#^Tu;8:d^;8:d#MR#^Tu;8:d^=8:dMR#\V4#R#):N�NN)�
EPOCH_YEARr
)�tt�year�month�mday�hour�min�secs&      r�_timegmr,Qs���(*�2��%�D��S�	
��	�!�u�"2��"2��	:;�d��b���
�d��b��� !�C�~�2�~��56��N��N���b�z��rc�\�Vf0\PP\PR7pM/\PPV\PR7pRVPVP
VPVPVPVP3,#)a0Return 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

��tzz%04d-%02d-%02d %02d:%02d:%02dZ)
�datetime�now�UTC�
fromtimestampr&r'�dayr)�minute�second��t�dts& r�	time2isozr:^s��	�y�
�
�
�
"�
"�h�l�l�
"�
3��
�
�
�
,�
,�Q�8�<�<�
,�
@��+�
������2�6�6�2�7�7�B�I�I�r�y�y�/B�B�Brc��Vf0\PP\PR7pM/\PPV\PR7pR\VP4,VP\VP^,
,VPVPVPVP3,#)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

r.z#%s, %02d-%s-%04d %02d:%02d:%02d GMT)
r0r1r2r3�DAYS�weekdayr4�MONTHSr'r&r)r5r6r7s& r�
time2netscaper?qs���	�y�
�
�
�
"�
"�h�l�l�
"�
3��
�
�
�
,�
,�Q�8�<�<�
,�
@��0��R�Z�Z�\��B�F�F�F�2�8�8�A�:�$6�
������"�)�)�R�Y�Y�40�0�0r�GMTr2�UT�Zz^([-+])?(\d\d?):?(\d\d)?$c�T�RpV\9d^pV#\PV4pV'dzR\VP	^44,pVP	^4'd)V^<\VP	^44,,pVP	^4R8XdV)pV#)Ni�-)�	UTC_ZONES�TIMEZONE_RE�search�int�group)r/�offset�ms&  r�offset_from_tz_stringrL�s���
�F�	�Y�����M�
���r�"����C�����
�O�+�F��w�w�q�z�z��"�s�1�7�7�1�:��"6�6���w�w�q�z�S� � ����Mrc	�8�\V4pV\P8�dR#\P	VP44^,pTf^pTf^pTf^p\T4p\T4p\T4p\T4pTR8d}\P!\P!44^,pT^d,p	Tp
Y(,T	,
pY�,
p	\T	4^28�dT	^8�dT^d,pM	T^d,
p\Y!YYET34pTe0TfRpTP4p\T4pTfR#Y�,
pT# \d<\T4pM \dR#i;i^Tu;8:d^8:d	MMTpELGR#i;i)Ni�r2)
rHr0�MAXYEAR�MONTHS_LOWER�index�lower�
ValueError�time�	localtime�absr,�upperrL)
r4�mon�yr�hrr*r+r/�imon�cur_yrrK�tmpr8rJs
&&&&&&&      r�	_str2timer]�sr��	�R��B�	�H������� � �����-�a�/��
�z��2�
�{�!�C�
�{�!�C�

�c�(�C�	�R��B�

�c�(�C�

�c�(�C�	�D�y�����	�	��,�Q�/���S�L����
�[�1�_��
�G���q�6�B�;��1�u�2��8�b��C�x�"�	��#�3�R�0�1�A��}�
�:��B�
�X�X�Z��&�r�*���>��
�J���H��[�	�	��s�8�D���	��	����?��?��C��	�s5�*E�F�E+�*F�+E;�6F�:E;�;F�FzV^[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	�n�\PV4pV'd�VP4p\P	V^,P44^,p\
V^,4V\
V^,4\
V^,4\
V^,4\V^,43p\V4#VP4p\PRV^4pR.^,wrSrgr�p
\PV4pVeVP4wrSrgr�p
MR#\WSWgW�V
4#)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.

�N)�STRICT_DATE_RErG�groupsrOrPrQrH�floatr,�lstrip�
WEEKDAY_RE�sub�LOOSE_HTTP_DATE_REr])�textrK�grWr%r4rXrYr*r+r/s&          r�	http2timeri�s���<	���d�#�A��
�H�H�J��� � ��1�����.��2���!�A�$�i��c�!�A�$�i��!�A�$�i��Q�q�T��E�!�A�$�K�1���r�{��
�;�;�=�D��>�>�"�d�A�&�D�'+�V�A�X�"�C�b�c��	�!�!�$�'�A��}�)*����&��"�#�B���S�r�s��4�4ra�^
    (\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	��VP4pR.^,wrr4rVp\PV4pVeVP4wr2rrVryMR#\	WW4WVV4#)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

N)rc�ISO_DATE_RErGrar])
rgr4rWrXrYr*r+r/rK�_s
&         r�iso2timerm2sh���;�;�=�D�'+�V�A�X�"�C�b�c��	���4� �A��}�-.�H�H�J�)���#�B����S�r�s��4�4rc�n�VP^4wrVPRVVPVR,#)z)Return unmatched part of re.Match object.N)�span�string)�match�start�ends&  r�	unmatchedrtSs2�����A��J�E��<�<�������S�T� 2�2�2rz^\s*([^=\s;,]+)z&^\s*=\s*\"([^\"\\]*(?:\\.[^\"\\]*)*)\"z^\s*=\s*([^\s;,]*)z\\(.)c��\V\4'dQh.pVEF�pTp.pV'Ed}\PV4pV'd�\	V4pVP^4p\PV4pV'd4\	V4pVP^4p\PRV4pML\PV4pV'd.\	V4pVP^4pVP4pMRpVPWg34K�VP4PR4'd6VP4R,pV'dVPV4.pEKL\P!RRV4wr�V	^8�gQRV:RV:R	V:24hTpEK�V'gEK�VPV4EK�	V#)
a�Parse 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"')]]

z\1N�,��NNz^[=\s;]*r_zsplit_header_words bug: 'z', 'z', )�
isinstance�str�HEADER_TOKEN_RErGrtrI�HEADER_QUOTED_VALUE_RE�HEADER_ESCAPE_REre�HEADER_VALUE_RE�rstrip�appendrc�
startswith�re�subn)
�
header_values�resultrg�	orig_text�pairsrK�name�value�non_junk�
nr_junk_charss
&         r�split_header_wordsr�\su��Z�-��-�-�-�-�
�F����	����d��&�&�t�,�A�� ��|���w�w�q�z��*�1�1�$�7���$�Q�<�D��G�G�A�J�E�,�0�0���>�E�'�.�.�t�4�A��(��|�� !����
�� %�����!%�����d�]�+�����)�)�#�.�.��{�{�}�R�(���&�-�-��.���+-�'�'�+�r�4�*H�'��$�q�(�.���e�-�.�(� ���5�&�-�-��&�G�H�Mrz[!#$%&'*+\-.^_`|~0-9A-Za-z]+�([\"\\])c�X�.pVF�p.pVF]wrEVeD\PV4'g \PRV4pRV,pV:RV:2pVP	V4K_	V'gKrVP	RPV44K�	RPV4#)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"'

�\\\1z"%s"�=�; �, )�HEADER_JOIN_TOKEN_RE�	fullmatch�HEADER_JOIN_ESCAPE_RErer��join)�lists�headersr��attr�k�vs&     r�join_header_wordsr��s����G������D�A��}�+�5�5�a�8�8�-�1�1�'�1�=�A���
�A� �!�$���K�K��N�
��4�����	�	�$��0���9�9�W��rc�~�VPR4'd
VR,pVPR4'dVRRpV#)�"rwN���)r��endswith�rgs&r�strip_quotesr��s9�����s����B�x���}�}�S����C�R�y���Krc�n�Rp.pVEF)p.pRp\VPR44F�wrgVP4pVPR4wr�p
VP4pV'gV^8XdM�KLV	'dV
P4MRp
V^8wdQVP	4pW�9dTpVR8XdV
e\V
4p
RpMVR8XdV
e\
\V
44p
VPW�34K�	V'gK�V'gVPR	4VPV4EK,	V#)
aAd-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�versionF�;r�NT)r��domain�path�securer��port�max-age)r��0)�	enumerate�split�strip�	partitionrQr�rir�)�
ns_headers�known_attrsr��	ns_headerr��version_set�ii�param�key�sep�val�lcs&           r�parse_ns_headersr��s��1�K��F��	�����#�9�?�?�3�#7�8�I�B��K�K�M�E�!�O�O�C�0�M�C�c��)�)�+�C����7���"%�#�)�)�+�$�C��Q�w��Y�Y�[���$��C��)�#���*�3�/��"&�K��I�%���'��S�(9�:���L�L�#��$�=9�@�5�����-�.��M�M�%� �W �Z�Mrz\.\d+$c��\PV4'dR#VR8XdR#V^,R8XgVR,R8XdR#R#)z*Return True if text is a host domain name.Fr_�.Tr���IPV4_RErGr�s&r�is_HDNr�s;���~�~�d�����r�z���A�w�#�~��b��S���rc�$�VP4pVP4pW8XdR#\V4'gR#VPV4pVR8XgV^8XdR#VPR4'gR#\VR,4'gR#R#)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�rwr�)rQr��rfindr�)�A�B�is&& r�domain_matchr�'sp��.	
���	�A�	���	�A��v���!�9�9��	����
�A��B�w�!�q�&���<�<������!�B�%�=�=��rc�@�\PV4'dR#R#)z\Return True if text is a sort-of-like a host domain name.

For accepting/blocking domains.

FTr�r�s&r�liberal_is_HDNr�Ns���~�~�d����rc�"�VP4pVP4p\V4'd\V4'gW8XdR#R#VPR4pV'dVPV4'dR#V'g	W8XdR#R#)zTFor blocking/accepting domains.

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

TFr�)rQr�r�r�)r�r��initial_dots&& r�user_domain_matchr�Xsg��	
���	�A�	���	�A��1���.��"3�"3��6����,�,�s�#�K��q�z�z�!�}�}���1�6��rz:\d+$c���VP4p\PPV4^,pVR8XdVP	RR4p\
P
RV^4pVP4#)z|Return request-host, as defined by RFC 2965.

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

r_�Host)�get_full_url�urllib�parse�urlparse�
get_header�cut_port_rererQ)�request�url�hosts&  r�request_hostr�msd���
�
�
 �C��<�<� � ��%�a�(�D��r�z��!�!�&�"�-���?�?�2�t�Q�'�D��:�:�<�rc�@�\V4;rRV9d
VR,pW!3#)zrReturn a tuple (request-host, effective request-host name).

As defined by RFC 2965, except both are lowercased.

r��.local)r�)r��erhn�req_hosts&  r�eff_request_hostr�}s+��#�7�+�+�D�
�(���(�"���>�rc���VP4p\PPV4p\	VP
4pVP
R4'g
RV,pV#)z6Path component of request-URI, as defined by RFC 2965.�/)r�r�r��urlsplit�escape_pathr�r�)r�r��partsr�s&   r�request_pathr��sO��
�
�
�
 �C��L�L�!�!�#�&�E��u�z�z�"�D��?�?�3����T�z���Krc���VPpVPR4pV^8�dW^,Rp\V4V#\
pV# \d\	RT4R#i;i)�:Nznonnumeric port: '%s')r��findrHrRr�DEFAULT_HTTP_PORT)r�r�r�r�s&   r�request_portr��sj���<�<�D��	�	�#��A��A�v��a�C�D�z��	���I��K�!���K���	��*�D�1��	�s�A�A!� A!z%/;:@&=+$,!~*'()z%([0-9a-fA-F][0-9a-fA-F])c�N�RVP^4P4,#)z%%%s)rIrV)rqs&r�uppercase_escaped_charr��s���E�K�K��N�(�(�*�*�*rc��\PPV\4p\P\V4pV#)zEEscape any invalid characters in HTTP URL, and uppercase all escapes.)r�r��quote�HTTP_PATH_SAFE�ESCAPED_CHAR_RErer�)r�s&rr�r��s2���<�<���d�N�3�D����5�t�<�D��Krc��VPR4pV^8�dEW^,RpVPR4p\V4'dV^8�gVR8Xd
RV,#V#)aReturn 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�N�local)r�r�)�hr��bs&  r�reachr��sU��4	
���s��A��A�v�
��c�d�G��
�F�F�3�K���!�9�9�!�q�&�A��L��q�5�L��Hrc�j�\V4p\V\VP44'gR#R#)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)r�r�r��origin_req_host)r�r�s& r�is_third_partyr��s,���G�$�H���%��(?�(?�"@�A�A��rc�Za�]tRtRtoRtRRltRtR
RltRtR
Rlt	R	t
R
tRtVt
R#)ri�a�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.

c��Ve\V4pVe\\V44pVfVRJd\R4hWnW nW0nW@nWPnVP4Vn	Wpn
W�nW�nW�n
W�nW�nW�nW�nW�nVVn\(P(!V4VnR#)NTz-if port is None, port_specified must be false)rHrbrRr�r�r�r��port_specifiedrQr��domain_specified�domain_initial_dotr��path_specifiedr�r��discard�comment�comment_url�rfc2109�copy�_rest)�selfr�r�r�r�r�r�r�r�r�r�r�r�r�r�r��restr�s&&&&&&&&&&&&&&&&&&r�__init__�Cookie.__init__�s�����#�g�,����#�e�G�n�*=���<�N�d�2��L�M�M����	��
��	�,���l�l�n��� 0��
#5���	�,����������&������Y�Y�t�_��
rc��WP9#�N�r)rr�s&&r�has_nonstandard_attr�Cookie.has_nonstandard_attr$s���z�z�!�!rNc�8�VPPW4#r)r�get)rr��defaults&&&r�get_nonstandard_attr�Cookie.get_nonstandard_attr&s���z�z�~�~�d�,�,rc�"�W PV&R#rr)rr�r�s&&&r�set_nonstandard_attr�Cookie.set_nonstandard_attr(s�� �
�
�4�rc�z�Vf\P!4pVPeVPV8:dR#R#)NTF)rSr�)rr1s&&r�
is_expired�Cookie.is_expired+s,���;�d�i�i�k���L�L�$�4�<�<�3�+>��rc��VPfRpMRVP,pVPV,VP,pVPeVP:RVP:2pMVPpRV:RV:R2#)Nr_r�r�z<Cookie z for �>)r�r�r�r�r�)r�p�limit�	namevalues&   r�__str__�Cookie.__str__1sd���9�9��"�a��d�i�i�-�a����a��$�)�)�+���:�:�!�#'�9�9�d�j�j�9�I��	�	�I��'0�%�8�8rc�v�.pRF/p\W4pVPV:R\V4:24K1	VPR\VP4,4VPR\VP4,4VP
P:RRPV4:R2#)r�r�zrest=%sz
rfc2109=%s�(r��))r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�)�getattrr��reprrr��	__class__�__name__r�)rrr�r�s&   r�__repr__�Cookie.__repr__;s������D��4�&�D��K�K�4��d��4�5��	
���I��T�Z�Z� 0�0�1����L�4����#5�5�6��>�>�2�2�D�I�I�d�O�D�Dr)rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�)Fr)r#�
__module__�__qualname__�__firstlineno__�__doc__rr	rrrrr$�__static_attributes__�__classdictcell__��
__classdict__s@rrr�s5�����"(%�T"�-�!��9�E�Erc�<a�]tRtRtoRtRtRtRtRtRt	Vt
R#)	riJaDefines 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.

c��\4h)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.

��NotImplementedError�r�cookier�s&&&r�set_ok�CookiePolicy.set_okSs
��"�#�#rc��\4h)zAReturn true if (and only if) cookie should be returned to server.r0r2s&&&r�	return_ok�CookiePolicy.return_ok\���!�#�#rc��R#)zMReturn false if cookies should not be returned, given cookie domain.
        T�)rr�r�s&&&r�domain_return_ok�CookiePolicy.domain_return_ok`���rc��R#)zKReturn false if cookies should not be returned, given cookie path.
        Tr;)rr�r�s&&&r�path_return_ok�CookiePolicy.path_return_oker>rr;N)r#r&r'r(r)r4r7r<r@r*r+r,s@rrrJs#�����$�$��
�rc
��a�]tRtRtoRt^t^t^t^t]],t	RRRRRRRRR]RRR3
Rlt
RtRtR	t
R
tRtRtR
tRtRtRtRtRtRtRtRtRtRtRtRtRtRtRt Rt!Vt"R#)rikzBImplements the standard rules for accepting and returning cookies.NTFc���W0nW@nWPnW`nWpnW�nW�nW�nW�nW�n	W�n
Ve\V4VnMRVnVe\V4pW n
R#)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_domainsrDrErFrGrHrIrJrKrLrMrNs&&&&&&&&&&&&&&rr�DefaultCookiePolicy.__init__usu��!�
���#6� �(��*��+F�(�&<�#� 0��,H�)�"4�� 0���&�$)�/�$:�D�!�$&�D�!��&�#�O�4�O� /�rc��VP#)z4Return the sequence of blocked domains (as a tuple).)rP�rs&rrR�#DefaultCookiePolicy.blocked_domains�����$�$�$rc�&�\V4VnR#)z$Set the sequence of blocked domains.N)rOrP)rrRs&&r�set_blocked_domains�'DefaultCookiePolicy.set_blocked_domains�s�� %�o� 6��rc�T�VPFp\W4'gKR#	R#)TF)rPr�)rr��blocked_domains&& r�
is_blocked�DefaultCookiePolicy.is_blocked�s%��"�3�3�N� ��8�8��4�rc��VP#)z=Return None, or the sequence of allowed domains (as a tuple).)rQrVs&rrS�#DefaultCookiePolicy.allowed_domains�rXrc�0�Ve\V4pWnR#)z-Set the sequence of allowed domains, or None.N)rOrQ)rrSs&&r�set_allowed_domains�'DefaultCookiePolicy.set_allowed_domains�s���&�#�O�4�O� /�rc�t�VPfR#VPFp\W4'gKR#	R#)NFT)rQr�)rr��allowed_domains&& r�is_not_allowed�"DefaultCookiePolicy.is_not_allowed�s4��� � �(��"�3�3�N� ��8�8��4�rc���\RVPVP4VPfQhRF(pRV,p\W4pV!W4'dK'R#	R#)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�set_ok_FT)r��
verifiabilityr�r�r�r��rr�r�r �rr3r��n�fn_name�fns&&&   rr4�DefaultCookiePolicy.set_ok�sZ��	�)�6�;�;����E��{�{�&�&�&�M�A���k�G���'�B��f�&�&��	N�rc�(�VPf$\RVPVP4R#VP^8�d VP'g\R4R#VP^8Xd VP
'g\R4R#R#)Nz0   Set-Cookie2 without version attribute (%s=%s)F�$   RFC 2965 cookies are switched off�$   Netscape cookies are switched offT)r�rr�r�rErDr2s&&&r�set_ok_version�"DefaultCookiePolicy.set_ok_version�sl���>�>�!�
�E��;�;����
.���>�>�A��d�l�l�l��9�:��
�^�^�q�
 ������9�:��rc��VP'dr\V4'daVP^8�d VP'd\	R4R#VP^8Xd VP
'd\	R4R#R#�rz>   third-party RFC 2965 cookie during unverifiable transactionFz>   third-party Netscape cookie during unverifiable transactionT��unverifiabler�r�rIrrJr2s&&&r�set_ok_verifiability�(DefaultCookiePolicy.set_ok_verifiability�si������N�7�$;�$;��~�~��!�d�&F�&F�&F��8�9�����1�$��)D�)D�)D��8�9��rc��VP^8XdLVP'd:VPPR4'd\	RVP4R#R#)r�$z'   illegal name (starts with '$'): '%s'FT)r�rLr�r�rr2s&&&r�set_ok_name�DefaultCookiePolicy.set_ok_name�sE��
�N�N�a��D�$E�$E�$E��K�K�"�"�3�'�'��<�f�k�k�J��rc��VP'd{\V4pVP^8�g$VP^8XdNVP'd<VP	VP
V4'g\
RVP
V4R#R#)rz7   path attribute %s is not a prefix of request path %sFT)r�r�r�rMr@r�r)rr3r��req_paths&&& r�set_ok_path�DefaultCookiePolicy.set_ok_path�sn��� � � �#�G�,�H����!�#��.�.�A�%�$�*A�*A�*A��'�'����W�=�=��!�"(�+�+�x�9��rc��VPVP4'd\RVP4R#VPVP4'd\RVP4R#VP'Edt\V4wr4VPpVP'd�VPR4^8�duVPR4pVPR^V4pV^8XdJWV^,RpWW^,Vp	V	P4R
9d\V4^8Xd\RV4R#VPR4'dVR,p
MTp
V
PR4^8�pV'g&VPR4'g\RV4R#VP^8XduVPV4'g^VPV
R24'gDVPR4'g-RV,PV4'g\R	WE4R#VP^8�g$VPVP ,'d \#WE4'g\R
WE4R#VP^8�g$VPVP$,'dOVR\V4)pVPR4^8�d*\&P)V4'g\RW�4R#R#)�"   domain %s is in user block-listF�&   domain %s is not in user allow-listr�Nz&   country-code second level domain %srwr�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)�co�ac�com�edu�org�net�gov�milrH�aero�biz�cat�coop�info�jobs�mobi�museumr��pro�travel�eu)r^r�rrgr�r�rH�countr�rQ�lenr�r�r�r�rK�DomainRFC2965Matchr��DomainStrictNoDotsr�rG)
rr3r�r�r�r�r��j�tld�sld�undotted_domain�
embedded_dots�host_prefixs
&&&          r�
set_ok_domain�!DefaultCookiePolicy.set_ok_domain�si���?�?�6�=�=�)�)��7����G�����v�}�}�-�-��;�V�]�]�K���"�"�"�-�g�6�N�H��]�]�F��!�!�!�v�|�|�C�'8�A�'=��L�L��%���L�L��a��+����6� �1���,�C� �1��Q�-�C��y�y�{�''�'�,/�s�8�q�=��G��P�$�� � ��%�%�"(��*��"(��,�1�1�#�6�!�;�M� ����x�)@�)@��H�����~�~��"����v�.�.����/�):�&�'A�B�B�����-�-��d�(�,�,�V�4�4��?��)�!�����"��&�&��)@�)@�@�@�#�D�1�1�� �!%�/� �����"��&�&��)@�)@�@�@�&�}��V���5���$�$�S�)�Q�.����x�0�0��K�&�0� �rc�@�VP'dm\V4pVfRpM\V4pVPP	R4Fp\V4YC8XgKR#	\RW1P4R#R# \d\RT4R#i;i)N�80rvz   bad port %s (not numeric)Fz$   request port (%s) not found in %sT)r�r�rzr�r�rHrRr�rr3r��req_portrs&&&  r�set_ok_port�DefaultCookiePolicy.set_ok_port4s���� � � �#�G�,�H������x�=���[�[�&�&�s�+��!���F��=��
�,��=����.����"�!��9�1�=� �!�s�B�B�Bc��\RVPVP4RF(pRV,p\W4pV!W4'dK'R#	R#)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).

rj�
return_ok_FT)r�rlr�r�r�r�rmrns&&&   rr7�DefaultCookiePolicy.return_okIsJ��	�)�6�;�;����E�R�A�"�1�n�G���'�B��f�&�&��	S�
rc���VP^8�d VP'g\R4R#VP^8Xd VP'g\R4R#R#)rrtFruT)r�rErrDr2s&&&r�return_ok_version�%DefaultCookiePolicy.return_ok_version[sE���>�>�A��d�l�l�l��9�:��
�^�^�q�
 ������9�:��rc��VP'dr\V4'daVP^8�d VP'd\	R4R#VP^8Xd VP
'd\	R4R#R#ryrzr2s&&&r�return_ok_verifiability�+DefaultCookiePolicy.return_ok_verifiabilitydsi������N�7�$;�$;��~�~��!�d�&F�&F�&F��%�&�����1�$��)D�)D�)D��%�&��rc�z�VP'd)VPVP9d\R4R#R#)z(   secure cookie with non-secure requestFT)r��typerNrr2s&&&r�return_ok_secure�$DefaultCookiePolicy.return_ok_secureps+���=�=�=�W�\�\��1F�1F�F��=�>��rc�b�VPVP4'd\R4R#R#)z   cookie expiredFT)r�_nowrr2s&&&r�return_ok_expires�%DefaultCookiePolicy.return_ok_expiresvs&�����T�Y�Y�'�'��&�'��rc���VP'dU\V4pVfRpVPPR4FpWC8XgKR#	\RW1P4R#R#)Nr�rvz0   request port %s does not match cookie port %sFT)r�r�r�rr�s&&&  r�return_ok_port�"DefaultCookiePolicy.return_ok_port|s`���;�;�;�#�G�,�H������[�[�&�&�s�+���=��
�,��I����.��rc��\V4wr4VPpV'd"VPR4'gRV,pMTpVP^8XdIVPVP
,'d&VP'gWT8wd\R4R#VP^8�d \WE4'g\RWE4R#VP^8Xd-RV,PV4'g\RW54R#R#)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�r�r�rK�DomainStrictNonDomainr�rr�r�)rr3r�r�r�r��	dotdomains&&&    r�return_ok_domain�$DefaultCookiePolicy.return_ok_domain�s���)�'�2��������&�+�+�C�0�0��f��I��I�
�N�N�a��
�
"�
"�T�%?�%?�
?�
?��'�'�'�F�N��-�
.���>�>�A��l�4�&@�&@��/�04�
>���>�>�Q���D��':�':�9�'E�'E���!�
+��rc���\V4wr4VPR4'g
RV,pVPR4'g
RV,pV'd"VPR4'gRV,pMTpVPV4'gVPV4'gR#VPV4'd\	RV4R#VPV4'd\	RV4R#R#)r�Fr�r�T)r�r�r�r^rrg)rr�r�r�r�r�s&&&   rr<�$DefaultCookiePolicy.domain_return_ok�s���*�'�2����"�"�3�'�'��8�|�H����s�#�#��t�8�D��&�+�+�C�0�0��f��I��I��!�!�)�,�,��
�
�i�0H�0H���?�?�6�"�"��7��@�����v�&�&��;�V�D��rc���\RV4\V4p\V4pW18XdR#VPV4'd*VP	R4'gW4V^,R8XdR#\RW14R#)z- checking cookie path=%sTr�z  %s does not path-match %sF)rr�r�r�r�)rr�r�r��pathlens&&&  rr@�"DefaultCookiePolicy.path_return_ok�sj���*�D�1���(���d�)������!�!�$�'�'��}�}�S�!�!�X�g�a�i�%@�C�%G���,�h�=�r)
rQrPrGrDrFrErNrHrKrLrMrJrI)�https�wss)#r#r&r'r(r)r�r�r��
DomainLiberal�DomainStrictrrRrZr^rSrcrgr4rvr|r�r�r�r�r7r�r�r�r�r�r�r<r@r*r+r,s@rrrks�����L��������M�%�&;�;�L�"&�t���%)�#�$�-1�(-�"/�.3�$)�"2�!0�F%�7��%�0���&
�
��	�:�x�*�$�
�����6�4�rc#��"�\VP44F5pRpVPRp\V4Rjx�L
V'dK1Vx�K7	R#L \dL#i;i5i)z)Iterates over nested mapping, depth-firstFTN)�list�values�items�
deepvalues�AttributeError)�mapping�objs& rr�r��sb����G�N�N�$�%����	'��I�I��G�!�#��&�&��w��I�&�
'��	�	��	�s7�A*�A�A*�A�	A*�
A*�A'�$A*�&A'�'A*c��]tRtRtRtR#)�Absenti�r;N�r#r&r'r(r*r;rrr�r��s��drr�c�a�]tRtRtoRt]P!R4t]P!R4t]P!R4t	]P!R4t
]P!R4t]P!R]P4t
R R
ltRtRtR
tRtRtRtRtRtRtRtRtRtRtR!RltRtRtRtRt Rt!Rt"Rt#Vt$R	#)"ri�z�Collection of HTTP cookies.

You may not need to know about this class: try
urllib.request.build_opener(HTTPCookieProcessor).open(url).
z\Wr�z\.?[^.]*z[^.]*z^\.+z^\#LWP-Cookies-(\d+\.\d+)Nc�p�Vf\4pWn\P!4Vn/VnR#r)r�_policy�
_threading�RLock�
_cookies_lock�_cookies�r�policys&&rr�CookieJar.__init__�s,���>�(�*�F���'�-�-�/�����
rc��WnR#r)r�r�s&&r�
set_policy�CookieJar.set_policy�s���rc���.pVPPW4'g.#\RV4VPV,pVP	4F�pVPPWR4'gK&WE,pVP
4FMpVPPWr4'g\R4K1\R4VPV4KO	K�	V#)z!Checking %s for cookies to returnz   not returning cookiez   it's a match)	r�r<rr��keysr@r�r7r�)rr�r��cookies�cookies_by_pathr��cookies_by_namer3s&&&     r�_cookies_for_domain�CookieJar._cookies_for_domain�s������|�|�,�,�V�=�=��I��2�F�;��-�-��/��#�(�(�*�D��<�<�.�.�t�=�=��-�3�O�)�0�0�2���|�|�-�-�f�>�>��4�5���(�)����v�&�3�	+��rc��.pVPP4F#pVPVPW144K%	V#)z2Return a list of cookies to be returned to server.)r�r��extendr�)rr�r�r�s&&  r�_cookies_for_request�CookieJar._cookies_for_requests:�����m�m�(�(�*�F��N�N�4�3�3�F�D�E�+��rc�>�VPRRR7Rp.pVEF�pVPpV'g"RpV^8�dVPRV,4VPeZVPPVP4'd/V^8�d(VPPRVP4pMVPpVPfVPVP4M"VPVP:RV:24V^8�gEKVP'd#VPRVP,4VPPR	4'dWVPpVP'g!VPR	4'd
VR
,pVPRV,4VPfEK�RpVP'dVR
VP,,pVPV4EK	V#)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).

c�,�\VP4#r)r�r�)�as&r�<lambda>�)CookieJar._cookie_attrs.<locals>.<lambda>s��3�q�v�v�;rT)r��reverseFz$Version=%sr�r�z
$Path="%s"r�rwz$Domain="%s"z$Portz="%s")�sortr�r�r��non_word_rerG�quote_rerer�r�r�r�r�r�r�r�)	rr�r��attrsr3r�r�r�rs	&&       r�
_cookie_attrs�CookieJar._cookie_attrss���	���.���=������F��n�n�G��"���Q�;��L�L���!8�9�
���)�� � �'�'����5�5�'�A�+��
�
�)�)�'�6�<�<�@�������|�|�#����V�[�[�)�������U�;�<���{��(�(�(��L�L�����!;�<��=�=�+�+�C�0�0�#�]�]�F�"�5�5�5��)�)�#�.�.�!'�����L�L��&�!8�9��;�;�*��A��,�,�,���6�;�;�!6�7���L�L��O�Q�T�rc�
�\R4VPP4\\P!44;VP
nVnVPV4pVPV4pV'd9VPR4'g"VPRRPV44VP
P'dbVP
P'gFVPR4'g/VF(pVP^8wgKVPRR4M	VPP4VP!4R# TPP4i;i)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��Cookie2z$Version="1"N)rr��acquirerHrSr�r�r�r��
has_header�add_unredirected_headerr�rErGr��release�clear_expired_cookies)rr�r�r�r3s&&   rr�CookieJar.add_cookie_headerMs#��	�"�#����"�"�$�	)�,/��	�	��,<�<�D�L�L���	��/�/��8�G��&�&�w�/�E���)�)�(�3�3��3�3� �$�)�)�E�"2�4����$�$�$�T�\�\�-F�-F�-F��&�&�y�1�1�%�F��~�~��*��7�7�	�>�R��&�
���&�&�(��"�"�$��
���&�&�(�s*�A4E&�<E&�E&�5E&�E&�$E&�&Fc��.pRpRpVEF&pV^,wrgRpRp	/p
/pVR,F�wr�VP4pW�9gW�9dTpW�9dV
fRp
W�9dK7VR8Xd$V
f\R4Rp	M�V
P4p
VR8XdV'dKrV
f\R4K�VR8Xd$Rp\V
4p
RpTPT
,p
W�9gW�9d(V
fVR
9d\R
V,4Rp	MW�V&K�W�V&K�	V	'dEKVPWgW�34EK)	V# \d\R	4Rp	KAi;i)a�Return 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�FrwTz%   missing value for domain attributezM   missing or invalid value for expires attribute: treating as session cookiez?   missing or invalid (non-numeric) value for max-age attributez!   missing value for %s attribute)r�r�)r�r�r�r�r�r�r��
commenturl)r�r�r	)rQrrHrRr�r�)r�	attrs_set�
cookie_tuples�
boolean_attrs�value_attrs�cookie_attrsr�r��max_age_set�
bad_cookie�standardrr�r�r�s&&             r�_normalized_cookie_tuples�#CookieJar._normalized_cookie_tuplesns����
�+�
�0��
&�L�&�q�/�K�D� �K��J��H��D�$�R�(�(����W�W�Y���$��(;��A��%�!�)��A��=����=��y��F�G�%)�
�����	�A��	�>�"� ��y�� F�G� ��	�>�"&�K����F��"�A��	�	�A�
�A��$�!�*<��	��!B�B��B�Q�F�G�%)�
��"#�Q�K���G�e)�h��� � �$�x�!>�?�Q&�T���5&��� 2�3�%)�
��	�s�6D6�6E�Ec��Vwr4rVVPR\4pVPR\4pVPR\4p	VPR\4p
VPRR4pVe
\V4pVPRR4pVPRR4p
VPR	R4pVPR
R4pV\JdVR8wdRp\	V4pMPRp\V4pVP
R
4pVR8wdV^8XdVRVpMVRV^,p\V4^8XdR
pV\JpRpV'd\VPR44pV\Jd\V4wppTpM VPR4'g
RV,pRpV	\Jd,V	f
\V4p	MRp\P!RRV	4p	MRp	V
\JdRp
Rp
M2W�P8:d#VPWxV4\#RWxV4R#\%VW4V	VVVVVVVV
V
VVV4# \dR#i;i \ dLGi;i)r�r�r�r�r�Nr�Fr�r�r	r_Tr�r�z\s+z2Expiring cookie, domain='%s', path='%s', name='%s'r�)rr�rHrRr�r�r�r��boolr�r�r�r�rer��clear�KeyErrorrr)r�tupr�r�r�rrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�s&&&                    r�_cookie_from_cookie_tuple�#CookieJar._cookie_from_cookie_tuple�sm��'*�#��X����h��/���|�|�F�F�+���|�|�F�F�+���,�,�y�&�1���,�,�y�$�/����
��g�,�����h��.���,�,�y�%�0���,�,�y�$�/���l�l�<��6���v��$�"�*�!�N��t�$�D�"�N���(�D��
�
�3��A��B�w��a�<����8�D����1��:�D��4�y�A�~�c�t�"��/��"���!%�f�&7�&7��&<�!=���V��-�g�6�N�H�d��F��"�"�3�'�'���Z�F����v���|�$�G�,��!%���v�v�f�b�$�/���D��f���G��G�
�	�	�
!�
��
�
�6��.�
�G���
'���g���N��.�0B��N�����!��
�
	��C�
��
��v�
��
�s$�5H1�7I�1I�?I�I�Ic��VPV4p.pVF/pVPWR4pV'gKVPV4K1	V#r)rrr�)rr
r�rr�rr3s&&&    r�_cookies_from_attrs_set�!CookieJar._cookies_from_attrs_set+sH���6�6�y�A�
��� �C��3�3�C�A�F��v�w�~�~�f�-�!��rc���\VPRR4pVfVPP'*pVF.pVP^8XgKRVnV'gK'^VnK0	R#)rFNT)r r�rEr�r�)rr��
rfc2109_as_nsr3s&&  r�_process_rfc2109_cookies�"CookieJar._process_rfc2109_cookies4sX������.C�T�J�
�� � $��� 4� 4�4�M��F��~�~��"�!%��� �=�&'�F�N�
rc��VP4pVPR.4pVPR.4p\\P!44;VPnVnVPPpVPPpV'g	V'd1V'g	V'd!V'g	V'dV'gV'g.#VP\V4V4pV'd�V'd�VP\V4V4p	VPV	4V'dB/p
VF(pRW�PVPVP 3&K*	V
3Rlp\#W�4p	V	'dVP%V	4V# \d\4.pL�i;i \d\4.p	L�i;i)zAReturn sequence of Cookie objects extracted from response object.zSet-Cookie2z
Set-CookieNc�P�VPVPVP3pW!9#r)r�r�r�)�	ns_cookie�lookupr�s&& r�no_matching_rfc2965�3CookieJar.make_cookies.<locals>.no_matching_rfc2965ms%��#�*�*�I�N�N�I�N�N�J�C��,�,r)r��get_allrHrSr�r�rErDrr��	Exceptionr!r�r r�r�r��filterr�)
r�responser�r��rfc2965_hdrs�ns_hdrsrErDr��
ns_cookiesr%r3r&s
&&&          r�make_cookies�CookieJar.make_cookies@sl���-�-�/�����}�b�9���/�/�,��3��(+�D�I�I�K�(8�8�����D�I��,�,�&�&���<�<�(�(���g����h��'��I�	��2�2�"�<�0�'�;�G��x�
 �!�9�9�$�W�-�w�8�
�

�)�)�*�5����%�F�HL�F�M�M�6�;�;����D�E�&�;A�-�$�$7�D�
�����z�*����C�	�%�'��G�	���
 �)�+��
�
 �s$�F�F1�F.�-F.�1G�
Gc�z�VPP4\\P!44;VPnVnVPP
W4'dVPV4VPP4R# TPP4i;i)z-Set a cookie if policy says it's OK to do so.N)	r�rrHrSr�r�r4�
set_cookierr2s&&&r�set_cookie_if_ok�CookieJar.set_cookie_if_okws�����"�"�$�	)�,/��	�	��,<�<�D�L�L���	��|�|�"�"�6�3�3�����'�
���&�&�(��D���&�&�(�s�A&B�B:c��VPpVPP4VPV9d/W!P&W!P,pVPV9d/W1P&W1P,pWVP
&VPP
4R# TPP
4i;i)z?Set a cookie, without checking whether or not it should be set.N)r�r�rr�r�r�r)rr3�c�c2�c3s&&   rr2�CookieJar.set_cookie�s����M�M�����"�"�$�	)��}�}�A�%�"�q���'7��=�=�!�B��{�{�"�$��b���o��K�K��B�$�v�{�{�O����&�&�(��D���&�&�(�s�A0B4�4Cc��\RVP44VPP4VP	W4FCpVP
P
W24'gK&\RV4VPV4KE	VPP4R# TPP4i;i)zAExtract cookies from response, where allowable given the request.zextract_cookies: %sz setting cookie: %sN)	rr�r�rr/r�r4r2r)rr+r�r3s&&& r�extract_cookies�CookieJar.extract_cookies�s����$�h�m�m�o�6����"�"�$�	)��+�+�H�>���<�<�&�&�v�7�7��0�&�9��O�O�F�+�?�

���&�&�(��D���&�&�(�s�2B*�-!B*�*Cc���Ve1VeVf\R4hVPV,V,VR#Ve&Vf\R4hVPV,VR#VeVPVR#/VnR#)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)rRr�)rr�r�r�s&&&&rr�CookieJar.clear�s�������D�L� �N�P�P��
�
�f�%�d�+�D�1�
�
��~� �D�F�F��
�
�f�%�d�+�
�
��
�
�f�%��D�Mrc�J�VPP4VFHpVP'gKVPVPVP
VP4KJ	VPP4R# TPP4i;i)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)r�rr�rr�r�r�r)rr3s& r�clear_session_cookies�CookieJar.clear_session_cookies�sq��	
���"�"�$�	)����>�>�>��J�J�v�}�}�f�k�k�6�;�;�G��
���&�&�(��D���&�&�(�s�B�5B�B"c�~�VPP4\P!4pVFMpVPV4'gKVP	VP
VPVP4KO	VPP4R# TPP4i;i)adDiscard 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)	r�rrSrrr�r�r�r)rr1r3s&  rr�CookieJar.clear_expired_cookies�s���	
���"�"�$�	)��)�)�+�C����$�$�S�)�)��J�J�v�}�}�f�k�k�6�;�;�G��
���&�&�(��D���&�&�(�s�.B �5B � B<c�,�\VP4#r)r�r�rVs&r�__iter__�CookieJar.__iter__�s���$�-�-�(�(rc�,�^pVFq!^,pK
	V#)z#Return number of contained cookies.r;)rr�r3s&  r�__len__�CookieJar.__len__�s��
���F�A��A�d��rc��.pVFq!P\V44K	RVPP:RRP	V4:R2#��<�[r�z]>)r�r!r"r#r��r�rr3s&  rr$�CookieJar.__repr__�s8�����F�H�H�T�&�\�2�d�!�^�^�4�4�d�i�i��l�C�Crc��.pVFq!P\V44K	RVPP:RRP	V4:R2#rK)r�rzr"r#r�rNs&  rr�CookieJar.__str__�s8�����F�H�H�S��[�1�d�!�^�^�4�4�d�i�i��l�C�Cr)r�r�r�r�r)NNN)%r#r&r'r(r)r��compiler�r��strict_domain_re�	domain_re�dots_re�ASCII�magic_rerr�r�r�r�rrrrr r/r3r2r;rr@rrErHr$rr*r+r,s@rrr�s�������*�*�U�#�K��z�z�+�&�H��z�z�+�.���
�
�8�$�I��j�j��!�G��z�z�6����A�H����$�9�v%�B_�BZ�x�
'�5�n)�)�
)��6
)�)�&)��D�
D�Drc��]tRtRtRtR#)ri�r;Nr�r;rrrr�s��$rc�La�]tRtRtoRtR	RltR
RltR
RltR
RltRt	Vt
R#)ri�z6CookieJar that can be loaded from and saved to a file.Nc��\PW4Ve\P!V4pWn\V4VnR#)ze
Cookies are NOT loaded from the named file until either the .load() or
.revert() method is called.

N)rr�os�fspath�filenamer�	delayload)rr^r_r�s&&&&rr�FileCookieJar.__init__�s6��	���4�(����y�y��*�H� �
��i���rc��\4h)zSave cookies to a file.r0)rr^�ignore_discard�ignore_expiress&&&&r�save�FileCookieJar.saver9rc���Vf+VPeVPpM\\4h\V4;_uu_4pVP	WAW#4RRR4R# +'giR#;i)zLoad cookies from a file.N)r^rR�MISSING_FILENAME_TEXT�open�_really_load�rr^rbrcrs&&&& r�load�FileCookieJar.loadsM�����}�}�(�T�]�]�(�"�#8�9�9�
�(�^�^�q����a�>�J��^�^�^�s�A�A0	c��Vf+VPeVPpM\\4hVPP	4\
P!VP4p/VnVPWV4TPP4R# \d	Y@nhi;i TPP4i;i)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^rRrgr�rr�deepcopyr�rk�OSErrorr)rr^rbrc�	old_states&&&& r�revert�FileCookieJar.revert
s������}�}�(�T�]�]�(�"�#8�9�9����"�"�$�	)��
�
�d�m�m�4�I��D�M�
��	�	�(�N�C�
���&�&�(���
� )�
��
��

���&�&�(�s�
'B7�2B!�!B4�4B7�7C)r�r_r^)NFN�NFF)r#r&r'r(r)rrdrkrqr*r+r,s@rrr�s"����@�
)�$�K�)�)rc�p�VPVP3RVP3RVP3.pVPeVPRVP34VP'dVPR4VP'dVPR	4VP'dVPR
4VP'dVPR4VP'd0VPR\\VP4434VP'dVPR4VP'dVPRVP34VP'dVPRVP34\!VP"P%44pVF0pVPV\'VP"V,434K2	VPR\'VP(434\+V.4#)
z�Return string representation of Cookie in the LWP cookie file format.

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

r�r�r�r�r�r	r�)�	path_specN)�	port_specN)�
domain_dotN)r�N)r�N)r�r�r�r�r�r�r�r�r�r�r�r:rbr�r�r��sortedrr�rzr�r�)r3r�r�r�s&   r�lwp_cookie_strry(s����+�+�v�|�|�	$�
�&�+�+�	�
�F�M�M�	"�	$�A��{�{�����&�&�+�+�)>� ?�
����a�h�h�':�;�
����a�h�h�':�;�
� � � �!�(�(�+?�"@�
�}�}�}�a�h�h�/�0�
�~�~�~�q�x�x��(��v�~�~�)>�?�!A�B�
�~�~�~�q�x�x� 1�2�
�~�~�~�q�x�x��F�N�N� ;�<�
����1�8�8�\�6�3E�3E�$F�G��&�,�,�#�#�%�&�D�
��	���!�S����a��)�*�+���H�H�i��V�^�^�,�
-�.��a�S�!�!rc�>a�]tRtRtoRtRRltR	RltRtRtVt	R#)
riDa?
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)

c�0�\P!4p.pVFapV'gVP'dKV'gVPV4'dK@VPR\	V4,4Kc	RPVR.,4#)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�
r_)rSr�rr�ryr�)rrbrcr1rOr3s&&&   r�
as_lwp_str�LWPCookieJar.as_lwp_strQsp���i�i�k�����F�!�f�n�n�n��!�f�&7�&7��&<�&<��
�H�H�&���)?�?�@���y�y��B�4�� � rNc���Vf+VPeVPpM\\4h\P!\P
!V\P\P,\P,R4R4;_uu_4pVPR4VPVPW#44RRR4R# +'giR#;i)N��wz#LWP-Cookies-2.0
)r^rRrgr\�fdopenrh�O_CREAT�O_WRONLY�O_TRUNC�writer}rjs&&&& rrd�LWPCookieJar.saveas������}�}�(�T�]�]�(�"�#8�9�9�
�Y�Y��G�G�H�b�j�j�2�;�;�6����C�U�K��
�
��
�G�G�(�)�
�G�G�D�O�O�N�C�D�
�
�
�
�s�2C�C)	c���VP4pVPPV4'gRV,p\V4h\P!4pRpRp	Rp
VP4;pR8wEd�VPV4'gK1V\
V4RP4p\V.4EFkpV^,wr�/p/pV	FpRVV&K
	VR,FTwppVeVP4pMRpVV
9gVV	9dTpVV	9dVfRpVVV&KAVV
9dVVV&KOVVV&KV	VPpV!R4pV!R4pVe\V4pVfRpV!R
4pVPR4p\V!R4W�V!R4V!R4VVV!R4V!R	4V!R4V!R4VVV!R4V!R
4V4pV'gVP'dEK8V'gVPV4'dEKZVPV4EKn	EK�R# \ dh\"d\%4\RT:RX:24hi;i)z5%r does not look like a Set-Cookie3 (LWP) format filezSet-Cookie3:rvrurwr�r�r�r�r�r�r�r�r	r_NFrwTr�z invalid Set-Cookie3 format file �: )rvrurwr�r�)r�r�r�r�r�r�r	)�readlinerXrGrrSr�r�r�r�rQrrmrr�rr2ror)r!)rrr^rbrc�magicr r1�headerrr
�line�datar�r�rrr�r�r�r�r�r�r�r�r6s&&&&&                     rri�LWPCookieJar._really_loadps]���
�
����}�}�#�#�E�*�*��$�%�C��C�.� ��i�i�k����.�
�0��
9	.��:�:�<�'�4�B�.����v�.�.���C��K�L�)�/�/�1��.��v�6�D�"&�q�'�K�D�!�H��D�*��&+����+� $�R�����1��=�!"����B�!%�B��+�-�2��3F� "�A��
�-� �y�d�!�*+�H�Q�K��+�-�*+�H�Q�K�&'�D��G�!)� !���A��	�l�G��	�l�G��*�"*�7�"3����"&���x�[�F�'-�'8�'8��'=�$��q��|�T� ��y�!�K�.�%�'7��<�� ��y�!�K�.� ��{�&�&� ��|� ���#�	%�A�*�a�i�i�i� �)�a�l�l�3�.?�.?� ��O�O�A�&�[7�/��f�	���	.�%�'��%�t�-�.�
.�	.�s+�".H0�EH0�0
H0�;H0�H0�0I$�I$r;)TTrs)
r#r&r'r(r)r}rdrir*r+r,s@rrrDs!����
�!� 
E�J.�J.rc�4a�]tRtRtoRtRtRRltRtVtR#)r	i�aB

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

c���\P!4p\PVP44'g\	RV,4hVP4;pR8wEdM/pVP\4'dRV\&V\\4RpVPR4'dVRRpVP4PR4'gVP4R8XdK�VPR4wr�r�r�pVR8HpV	R8Hp	V
R8XdTp
RpVPR4pW�8XgQhRpVR8XdRpRp\^W�RRW�VV
RVVVRRV4pV'gVP'dEK.V'gVPV4'dEKPVPV4EKdR# \ dh\"d\%4\	R	T:R
X:24hi;i)
z4%r does not look like a Netscape format cookies filer_Nr|�	�TRUEr�FTz%invalid Netscape format cookies file r�r�)�#r)rS�NETSCAPE_MAGIC_RGXrqr�rr��HTTPONLY_PREFIX�
HTTPONLY_ATTRr�r�r�r�rr�rr2ror)r!)rrr^rbrcr1r�rr�r�r�r�r�r�r�r�r�r6s&&&&&             rri�MozillaCookieJar._really_load�s����i�i�k��!�'�'��
�
��5�5��F����
�<	.��:�:�<�'�4�B�.���
�?�?�?�3�3�*,�D��'���O� 4� 5�6�D��=�=��&�&�t�C�R�y���J�J�L�+�+�J�7�7��J�J�L�B�&���
�
�4�(�M��$��u� �F�*��$4��$>� ��2�:�!�D� �E�$�/�/��4��'�6�6�6����b�=�"�G�"�G��1�d���!�[���!�"�"����	!��&�!�)�)�)��%�!�,�,�s�*;�*;������"�i/��l�	���	.�%�'��%�t�-�.�
.�	.�s1�4F8�1F8�9CF8�=
F8�F8�F8�8G,�
G,Nc�H�Vf+VPeVPpM\\4h\P!\P
!V\P\P,\P,R4R4;_uu_4pVP\4\P!4pVEF8pVPpV'gVP'dK,V'gVPV4'dKMVP'dRpMRpVP!R4'dRp	MRp	VP"e\%VP"4p
MRp
VP&fRpVP(pMVP(pVP&pVP+\,4'd\.V,pVPRP1WyVP2W�W�.4R,4EK;	RRR4R# +'giR#;i)	Nr�r�r��FALSEr�r_r�r|)r^rRrgr\r�rhr�r�r�r��NETSCAPE_HEADER_TEXTrSr�r�rr�r�r�rzr�r�r	r�r�r�r�)
rr^rbrcrr1r3r�r�r�r�r�r�s
&&&&         rrd�MozillaCookieJar.save#s������}�}�(�T�]�]�(�"�#8�9�9�
�Y�Y��G�G�H�b�j�j�2�;�;�6����C�U�K��
�
��
�G�G�(�)��)�)�+�C�������%�&�.�.�.��%�&�*;�*;�C�*@�*@���=�=�=�6�&�&�f��$�$�S�)�)��;�$+�k��>�>�-�!�&�.�.�1�G� �G��<�<�'��D�"�K�K�E�!�;�;�D�"�L�L�E��.�.�}�=�=�,�v�5�F�����I�I�v�F�K�K�%��=�>����3�

�
�
�
�s3�AH�3	H�=H�H�(H�A:H�?AH�H!	r;rs)	r#r&r'r(r)rirdr*r+r,s@rr	r	�s�����>D.�L'�'r)rrrrrrrr	)�Mon�Tue�Wed�Thu�Fri�Sat�Sun)�Jan�Feb�Mar�Apr�May�Jun�Jul�Aug�Sep�Oct�Nov�Decr)Zr)�__all__r\rr0r�rS�urllib.parser��urllib.request�	threadingr��http.client�http�calendarr
rr
rr�r�rz�client�	HTTP_PORTr�rSr�rgr�r!r$r,r<r>rQrOr:r?rErWrFrLr]r`�Ird�Xrfrirkrmrtr{r|r~r}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr�r�rrorrryrr	)r's0r�<module>r�s���6M��
���	��#����
��	
����
�������-�-�.���Z�Z� @�A��:����A��
��9��
4��+1�2�6�%���
�6�2��B�&0�(�D�%��t�T�3��=�	��j�j�5�r�x�x�@���6
�p���,�-/�X�X�7���Z�Z�2�B�D�D�2�8�8�O�E�
��Z�Z��&
�D�D�2�8�8�O�)��*65�p�j�j�
� �4�4�"�)�)��#��$5�B3�
���$6�7�����$M�N�����$9�:���:�:�h�'��S�j�z�z�"A�B���
�
�;�/���2�A�H
�*�*�Y����
)��
�%�N��(�j�j��2�8�8�,��� 	��� $���*�*�9�:��+��!
�F�"_E�_E�D��B_�,�_�B�"��LD�LD�`���4)�I�4)�n"�8v.�=�v.�rM�}�M��C;3s�K