Your IP : 3.17.61.124


Current Path : /opt/alt/python313/lib64/python3.13/http/__pycache__/
Upload File :
Current File : //opt/alt/python313/lib64/python3.13/http/__pycache__/cookiejar.cpython-313.opt-1.pyc

�

*}g~.��r�Sr/SQrSSKrSSKrSSKrSSKrSSKrSSKrSSK	rSSK
rSSKr
SSKJr SrSqSrSrSr\"\
R,R.5r\R2"S	5rS
rSrSrS
rSr/SQr /SQr!\!Vs/sHoRE5PM snr#SKSjr$SKSjr%SSSSS.r&\R2"S\RN5r(Sr)Sr*\R2"S\RN5r+\R2"S\RX\RN-5r-\R2"S\R\\RN-5r/Sr0\R2"S\R\\RN-5r1Sr2Sr3\R2"S5r4\R2"S5r5\R2"S 5r6\R2"S!5r7S"r8\R2"S#5r9S$r:S%r;S&r<\R2"S'\RN5r=S(r>S)r?S*r@S+rA\R2"S,\RN5rBS-rCS.rDS/rES0rFS1rG\R2"S25rHS3rIS4rJS5rKS6rL"S7S85rM"S9S:5rN"S;S<\N5rOS=rP"S>S?5rQ"S@SA5rR"SBSC\S5rT"SDSE\R5rUSFrV"SGSH\U5rW"SISJ\U5rXgs snf)La�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)�timegmFc��[(dg[(dSSKnURS5q[R"U6$)Nr
zhttp.cookiejar)�debug�logger�logging�	getLogger)�argsrs  �5/opt/alt/python313/lib64/python3.13/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��SSKnSSKnSSKnUR5nUR	SU5 UR5nUR
SU-SS9 g)Nr
zhttp.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���USSupp4pVU[:�a[SUs=::aS::aNO gSUs=::aS::a>O gSUs=::aS::a.O gSUs=::aS::aO gSUs=::aS::aO g[U5$g)	N����r
��;�=)�
EPOCH_YEARr)�tt�year�month�mday�hour�min�secs       r�_timegmr3Qs���(*�2�A��%�D��S�	
��	�!�u�"2��"2��	:;�d��b���
�d��b��� !�C�~�2�~��56��N��N���b�z��r)�Mon�Tue�Wed�Thu�Fri�Sat�Sun)�Jan�Feb�Mar�Apr�May�Jun�Jul�Aug�Sep�Oct�Nov�Decc�F�Uc,[RR[RS9nO,[RRU[RS9nSURUR
URURURUR4-$)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.�dayr0�minute�second��t�dts  r�	time2isozrT^s��	�y�
�
�
�
"�
"�h�l�l�
"�
3��
�
�
�
,�
,�Q�8�<�<�
,�
@��+�
������2�6�6�2�7�7�B�I�I�r�y�y�/B�B�Brc��Uc,[RR[RS9nO,[RRU[RS9nS[UR5UR[URS-
URURURUR4-$)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

rHz#%s, %02d-%s-%04d %02d:%02d:%02d GMTr%)
rJrKrLrM�DAYS�weekdayrN�MONTHSr.r-r0rOrPrQs  r�
time2netscaperYqs���	�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)�GMTrL�UT�Zz^([-+])?(\d\d?):?(\d\d)?$c�4�SnU[;aSnU$[RU5nU(akS[UR	S55-nUR	S5(a US[UR	S55--nUR	S5S:XaU*nU$)Nr
ir��<r%�-)�	UTC_ZONES�TIMEZONE_RE�search�int�group)rI�offset�ms   r�offset_from_tz_stringrh�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	���[U5nU[R:�ag[R	UR55S-nUcSnUcSnUcSn[U5n[U5n[U5n[U5nUS:a^[R"[R"55SnUS-n	Un
X(-U	-
nX�-
n	[U	5S:�aU	S:�aUS-nOUS-
n[X!XXEU45nUb(UcSnUR5n[U5nUcgX�-
nU$![a6 [U5nO![a gf=fSUs=::aS::aO OUnGNgf=f)Nr%r&r
i��d�2rL)
rdrJ�MAXYEAR�MONTHS_LOWER�index�lower�
ValueError�time�	localtime�absr3�upperrh)
rN�mon�yr�hrr1r2rI�imon�cur_yrrg�tmprRrfs
             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�&D#�#
E#�.D:�9E#�:
E�E#�E�E#�"E#zV^[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	�(�[RU5nU(a�UR5n[R	USR55S-n[
US5U[
US5[
US5[
US5[US54n[U5$UR5n[RSUS5nS/S	-upSpgp�n
[RU5nUbUR5upSpgp�n
Og[XSXgX�U
5$)
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_RErc�groupsrmrnrord�floatr3�lstrip�
WEEKDAY_RE�sub�LOOSE_HTTP_DATE_REr{)�textrg�grur,rNrvrwr1r2rIs           r�	http2timer��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	��UR5nS/S-upp4pVn[RU5nUbUR5up2ppVpyOg[	XX4XVU5$)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�)r��ISO_DATE_RErcr�r{)
r�rNrurvrwr1r2rIrg�_s
          r�iso2timer�2sh���;�;�=�D�'+�V�A�X�"�C�b�c��	���4� �A��}�-.�H�H�J�)���#�B����S�r�s��4�4rc�f�URS5upURSUURUS-$)z)Return unmatched part of re.Match object.r
N)�span�string)�match�start�ends   r�	unmatchedr�Ss2�����A��J�E��<�<�������S�T� 2�2�2rz^\s*([^=\s;,]+)z&^\s*=\s*\"([^\"\\]*(?:\\.[^\"\\]*)*)\"z^\s*=\s*([^\s;,]*)z\\(.)c�(�/nUGH�nUn/nU(Ga][RU5nU(a�[U5nURS5n[RU5nU(a3[U5nURS5n[
R
SU5nOK[RU5nU(a-[U5nURS5nUR5nOSnURXg45 OnUR5RS5(a.UR5SSnU(aURU5 /nO[R"SSU5up�UnU(aGM]U(dGMwURU5 GM� U$)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"')]]

r%z\1N�,z^[=\s;]*r)�HEADER_TOKEN_RErcr�re�HEADER_QUOTED_VALUE_RE�HEADER_ESCAPE_REr��HEADER_VALUE_RE�rstrip�appendr��
startswith�re�subn)
�
header_values�resultr��	orig_text�pairsrg�name�value�non_junk�
nr_junk_charss
          r�split_header_wordsr�\sK��\�F����	�����&�&�t�,�A�� ��|���w�w�q�z��*�1�1�$�7���$�Q�<�D��G�G�A�J�E�,�0�0���>�E�'�.�.�t�4�A��(��|�� !����
�� %�����!%�����d�]�+�����)�)�#�.�.��{�{�}�Q�R�(���&�-�-��.���+-�'�'�+�r�4�*H�'�� ��?�d�@�5�&�-�-��&�G�H�Mr�([\"\\])c�N�/nUH�n/nUHYupEUb@[R"SU5(d[RSU5nSU-nU<SU<3nUR	U5 M[ U(dMmUR	SRU55 M� SRU5$)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"'

z^\w+$�\\\1z"%s"�=�; �, )r�rc�HEADER_JOIN_ESCAPE_REr�r��join)�lists�headersr��attr�k�vs      r�join_header_wordsr��s����G������D�A��}��y�y��1�-�-�-�1�1�'�1�=�A���
�A� �!�$���K�K��N�
��4�����	�	�$��0���9�9�W��rc�r�URS5(aUSSnURS5(aUSSnU$)N�"r%���)r��endswith�r�s r�strip_quotesr��s;�����s����A�B�x���}�}�S����C�R�y���Krc�X�Sn/nUGHn/nSn[URS55H�upgUR5nURS5up�n
UR5nU(d
US:Xa O�MJU	(aU
R5OSn
US:waKUR	5nX�;aUnUS:XaU
b[U
5n
SnOUS	:XaU
b[
[U
55n
URX�45 M� U(dM�U(dURS
5 URU5 GM! U$)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�domain�path�secure�version�port�max-ageF�;r�r
Nr�Tr�)r��0)�	enumerate�split�strip�	partitionror�r�r�)�
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�n�[RU5(agUS:XagUSS:Xd	USS:Xagg)z*Return True if text is a host domain name.Frr
�.r�T��IPV4_RErcr�s r�is_HDNr�s;���~�~�d�����r�z���A�w�#�~��b��S���rc��UR5nUR5nX:Xag[U5(dgURU5nUS:XdUS:XagURS5(dg[USS5(dgg)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)ror��rfindr�)�A�B�is   r�domain_matchr�&sr��.	
���	�A�	���	�A��v���!�9�9��	����
�A��B�w�!�q�&���<�<������!�A�B�%�=�=��rc�:�[RU5(agg)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�Ms���~�~�d����rc�
�UR5nUR5n[U5(a[U5(dX:XaggURS5nU(aURU5(agU(dX:Xagg)zTFor blocking/accepting domains.

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

TFr�)ror�r�r�)r�r��initial_dots   r�user_domain_matchr�Wsg��	
���	�A�	���	�A��1���.��"3�"3��6����,�,�s�#�K��q�z�z�!�}�}���1�6��rz:\d+$c���UR5n[RRU5SnUS:XaUR	SS5n[
R
SUS5nUR5$)z|Return request-host, as defined by RFC 2965.

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

r%r�Host)�get_full_url�urllib�parse�urlparse�
get_header�cut_port_rer�ro)�request�url�hosts   r�request_hostr�lsd���
�
�
 �C��<�<� � ��%�a�(�D��r�z��!�!�&�"�-���?�?�2�t�Q�'�D��:�:�<�rc�6�[U5=pSU;aUS-nX!4$)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���UR5n[RRU5n[	UR
5nUR
S5(dSU-nU$)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��URnURS5nUS:�aXS-Sn[U5 U$[
nU$![a [	SU5 gf=f)N�:r
r%znonnumeric port: '%s')r��findrdrpr�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�Az%/;:@&=+$,!~*'()z%([0-9a-fA-F][0-9a-fA-F])c�F�SURS5R5-$)Nz%%%sr%)rert)r�s r�uppercase_escaped_charr�s���E�K�K��N�(�(�*�*�*rc��[RRU[5n[R[U5nU$)zEEscape any invalid characters in HTTP URL, and uppercase all escapes.)r�r��quote�HTTP_PATH_SAFE�ESCAPED_CHAR_REr�r)r�s rr�r��s2���<�<���d�N�3�D����5�t�<�D��Krc��URS5nUS:�a9XS-SnURS5n[U5(aUS:�dUS:XaSU-$U$)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�r
r%N�local)rr�)�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�d�[U5n[U[UR55(dgg)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�P�\rSrSrSrSSjrSrS
SjrSrS
Sjr	S	r
S
rSrg)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��Ub[U5nUb[[U55nUcUSLa[S5eXlX lX0lX@lXPlUR5Ul	Xpl
X�lX�lX�l
X�lX�lX�lX�lX�lUUl[(R("U5Ulg)NTz-if port is None, port_specified must be false)rdr�rpr�r�r�r��port_specifiedror��domain_specified�domain_initial_dotr��path_specifiedr�r��discard�comment�comment_url�rfc2109�copy�_rest)�selfr�r�r�r�rr�rrr�rr�r�rrr�restrs                  r�__init__�Cookie.__init__�s�����#�g�,����#�e�G�n�*=���<�N�d�2��L�M�M����	��
��	�,���l�l�n��� 0��
#5���	�,����������&������Y�Y�t�_��
rc��XR;$�N�r)rr�s  r�has_nonstandard_attr�Cookie.has_nonstandard_attr#s���z�z�!�!rNc�8�URRX5$r")r�get)rr��defaults   r�get_nonstandard_attr�Cookie.get_nonstandard_attr%s���z�z�~�~�d�,�,rc� �X RU'gr"r#)rr�r�s   r�set_nonstandard_attr�Cookie.set_nonstandard_attr's�� �
�
�4�rc�p�Uc[R"5nURbURU::agg�NTF)rqr�)rrKs  r�
is_expired�Cookie.is_expired*s,���;�d�i�i�k���L�L�$�4�<�<�3�+>��rc��URcSnOSUR-nURU-UR-nURbUR<SUR<3nOURnSU<SU<S3$)Nrr�r�z<Cookie z for �>)r�r�r�r�r�)r�p�limit�	namevalues    r�__str__�Cookie.__str__0sd���9�9��"�a��d�i�i�-�a����a��$�)�)�+���:�:�!�#'�9�9�d�j�j�9�I��	�	�I��'0�%�8�8rc�f�/nSH/n[X5nURU<S[U5<35 M1 URS[UR5-5 URS[UR5-5 UR
R<SSRU5<S3$)N)r�r�r�r�rr�rrr�rr�r�rrrr�zrest=%sz
rfc2109=%s�(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)rrrrr�rrr�r�r�rr�rrr�r�r�)Fr")
r?�
__module__�__qualname__�__firstlineno__�__doc__rr$r)r,r0r7r@�__static_attributes__�rrrr�s1���6�(%�T"�-�!��9�Errc�0�\rSrSrSrSrSrSrSrSr	g)	riIaDefines 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��[5e)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_okRs
��"�#�#rc��[5e)zAReturn true if (and only if) cookie should be returned to server.rJrLs   r�	return_ok�CookiePolicy.return_ok[���!�#�#rc��g)zMReturn false if cookies should not be returned, given cookie domain.
        TrG)rr�r�s   r�domain_return_ok�CookiePolicy.domain_return_ok_���rc��g)zKReturn false if cookies should not be returned, given cookie path.
        TrG)rr�r�s   r�path_return_ok�CookiePolicy.path_return_okdrWrrGN)
r?rBrCrDrErNrQrUrYrFrGrrrrIs���$�$��
rrc
���\rSrSrSrSrSrSrSr\\-r	SSSS	SS	S	SS	\S	S	S
4
Sjr
SrS
rSr
SrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrS rS!r S"r!g)#rijzBImplements the standard rules for accepting and returning cookies.r%rr}r
NTF)�https�wssc���X0lX@lXPlX`lXplX�lX�lX�lX�lX�l	X�l
Ub[U5UlOSUlUb[U5nX l
g)zAConstructor arguments should be passed as keyword arguments only.NrG)�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`rarbrcrdrerfrgrhris              rr�DefaultCookiePolicy.__init__tsu��!�
���#6� �(��*��+F�(�&<�#� 0��,H�)�"4�� 0���&�$)�/�$:�D�!�$&�D�!��&�#�O�4�O� /�rc��UR$)z4Return the sequence of blocked domains (as a tuple).)rk�rs rrm�#DefaultCookiePolicy.blocked_domains�����$�$�$rc�$�[U5Ulg)z$Set the sequence of blocked domains.N)rjrk)rrms  r�set_blocked_domains�'DefaultCookiePolicy.set_blocked_domains�s�� %�o� 6��rc�N�URHn[X5(dM g gr/)rkr�)rr��blocked_domains   r�
is_blocked�DefaultCookiePolicy.is_blocked�s%��"�3�3�N� ��8�8��4�rc��UR$)z=Return None, or the sequence of allowed domains (as a tuple).)rlrqs rrn�#DefaultCookiePolicy.allowed_domains�rsrc�,�Ub[U5nXlg)z-Set the sequence of allowed domains, or None.N)rjrl)rrns  r�set_allowed_domains�'DefaultCookiePolicy.set_allowed_domains�s���&�#�O�4�O� /�rc�j�URcgURHn[X5(dM g g)NFT)rlr�)rr��allowed_domains   r�is_not_allowed�"DefaultCookiePolicy.is_not_allowed�s4��� � �(��"�3�3�N� ��8�8��4�rc��[SURUR5 SH"nSU-n[X5nU"X5(aM" g g)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��
verifiabilityr�r�r�r��set_ok_FT�rr�r�r<�rrMr��n�fn_name�fns      rrN�DefaultCookiePolicy.set_ok�sM��	�)�6�;�;����E�N�A���k�G���'�B��f�&�&��	N�rc��URc"[SURUR5 gURS:�aUR(d[S5 gURS:XaUR
(d[S5 gg)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_rLs   r�set_ok_version�"DefaultCookiePolicy.set_ok_version�sh���>�>�!�
�E��;�;����
.���>�>�A��d�l�l��9�:��
�^�^�q�
 �����9�:��rc��UR(aj[U5(aZURS:�aUR(a[	S5 gURS:XaUR
(a[	S5 gg�Nr
z>   third-party RFC 2965 cookie during unverifiable transactionFz>   third-party Netscape cookie during unverifiable transactionT��unverifiablerr�rdrrerLs   r�set_ok_verifiability�(DefaultCookiePolicy.set_ok_verifiability�s`�����N�7�$;�$;��~�~��!�d�&F�&F��8�9�����1�$��)D�)D��8�9��rc��URS:XaHUR(a7URRS5(a[	SUR5 gg)Nr
�$z'   illegal name (starts with '$'): '%s'FT)r�rgr�r�rrLs   r�set_ok_name�DefaultCookiePolicy.set_ok_name�sB��
�N�N�a��D�$E�$E��K�K�"�"�3�'�'��<�f�k�k�J��rc��UR(au[U5nURS:�d!URS:XaJUR(a9UR	UR
U5(d[
SUR
U5 gg)Nr
z7   path attribute %s is not a prefix of request path %sFT)rr�r�rhrYr�r)rrMr��req_paths    r�set_ok_path�DefaultCookiePolicy.set_ok_path�sh��� � �#�G�,�H����!�#��.�.�A�%�$�*A�*A��'�'����W�=�=��!�"(�+�+�x�9��rc��URUR5(a[SUR5 gURUR5(a[SUR5 gUR(GaB[U5up4URnUR(a}URS5S:�ahURS5nURSSU5nUS:Xa>XVS-SnXWS-Un	U	R5S;a[U5S:Xa
[S	U5 gURS5(aUSSn
OUn
U
RS5S:�nU(d#URS
5(d
[SU5 gURS:XakURU5(dUURU
S
35(d<URS5(d&SU-RU5(d
[SXE5 gURS:�dURUR -(a[#XE5(d
[S
XE5 gURS:�dURUR$-(aKUS[U5*nURS5S:�a'[&R)U5(d
[SX�5 gg)N�"   domain %s is in user block-listF�&   domain %s is not in user allow-listr�rr
r%)�co�ac�com�edu�org�net�gov�milrd�aero�biz�cat�coop�info�jobs�mobi�museumr��pro�travel�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)ryr�rr�rr�rc�countr�ro�lenr�rr�r�rf�DomainRFC2965Matchr��DomainStrictNoDotsr�rc)
rrMr�r�r�r�r��j�tld�sld�undotted_domain�
embedded_dots�host_prefixs
             r�
set_ok_domain�!DefaultCookiePolicy.set_ok_domain�sb���?�?�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�0�UR(ah[U5nUcSnO[U5nURR	S5Hn[U5 XC:XdM g [SX1R5 gg![a [SU5  gf=f)N�80r�z   bad port %s (not numeric)Fz$   request port (%s) not found in %sT)rr�strr�r�rdrpr�rrMr��req_portr4s     r�set_ok_port�DefaultCookiePolicy.set_ok_port3s���� � �#�G�,�H������x�=���[�[�&�&�s�+��!���F��=��
�,��=����.����"�!��9�1�=� �!�s�
A;�;B�Bc��[SURUR5 SH"nSU-n[X5nU"X5(aM" g g)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�r�r�r�r�r��
return_ok_FTr�r�s      rrQ�DefaultCookiePolicy.return_okHsJ��	�)�6�;�;����E�R�A�"�1�n�G���'�B��f�&�&��	S�
rc��URS:�aUR(d[S5 gURS:XaUR(d[S5 gg)Nr
r�Fr�T)r�r`rr_rLs   r�return_ok_version�%DefaultCookiePolicy.return_ok_versionZsA���>�>�A��d�l�l��9�:��
�^�^�q�
 �����9�:��rc��UR(aj[U5(aZURS:�aUR(a[	S5 gURS:XaUR
(a[	S5 ggr�r�rLs   r�return_ok_verifiability�+DefaultCookiePolicy.return_ok_verifiabilitycs`�����N�7�$;�$;��~�~��!�d�&F�&F��%�&�����1�$��)D�)D��%�&��rc�r�UR(a&URUR;a[S5 gg)Nz(   secure cookie with non-secure requestFT)r��typerirrLs   r�return_ok_secure�$DefaultCookiePolicy.return_ok_secureos)���=�=�W�\�\��1F�1F�F��=�>��rc�\�URUR5(a[S5 gg)Nz   cookie expiredFT)r0�_nowrrLs   r�return_ok_expires�%DefaultCookiePolicy.return_ok_expiresus&�����T�Y�Y�'�'��&�'��rc���UR(aP[U5nUcSnURRS5H
nXC:XdM
 g [SX1R5 gg)Nr�r�z0   request port %s does not match cookie port %sFT)r�rr�rr�s     r�return_ok_port�"DefaultCookiePolicy.return_ok_port{s^���;�;�#�G�,�H������[�[�&�&�s�+���=��
�,��I����.��rc���[U5up4URnU(aURS5(dSU-nOUnURS:Xa@URUR
-(a"UR(dXT:wa[S5 gURS:�a[XE5(d
[SXE5 gURS:Xa&SU-RU5(d
[SX55 gg)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�r�r�rf�DomainStrictNonDomainrrr�r�)rrMr�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��[U5up4URS5(dSU-nURS5(dSU-nU(aURS5(dSU-nOUnURU5(dURU5(dgURU5(a
[	SU5 gURU5(a
[	SU5 gg)Nr�Fr�r�T)r�r�r�ryrr�)rr�r�r�r�r�s      rrU�$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���[SU5 [U5n[U5nX1:XagURU5(a"UR	S5(dX4US-S:Xag[SX15 g)Nz- checking cookie path=%sTr�r%z  %s does not path-match %sF)rr�r�r�r�)rr�r�r��pathlens     rrY�"DefaultCookiePolicy.path_return_ok�sj���*�D�1���(���d�)������!�!�$�'�'��}�}�S�!�!�X�g�a�i�%@�C�%G���,�h�=�r)
rlrkrbr_rar`rircrfrgrhrerd)"r?rBrCrDrEr�r�r��
DomainLiberal�DomainStrictrrmruryrnr~r�rNr�r�r�r�r�r�rQr�r�r�r�r�r�rUrYrFrGrrrrjs���L��������M�%�&;�;�L�"&�t���%)�#�$�-1�(-�"/�.3�$)�"2�!0�F%�7��%�0���&
�
��	�:�x�*�$�
�����6�4rrc#��# �[UR55H4nSnUR Sn[U5Shv�N U(aM0Uv� M6 gN![a N f=f7f)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��\rSrSrSrg)�Absenti�rGN�r?rBrCrDrFrGrrr�r��s��drr�c��\rSrSrSr\R"S5r\R"S5r\R"S5r	\R"S5r
\R"S5r\R"S\R5r
S S
jrSrSrS
rSrSrSrSrSrSrSrSrSrSrS!SjrSrSrSrSr Sr!Sr"Sr#g	)"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�l�Uc
[5nXl[R"5Ul0Ulgr")r�_policy�
_threading�RLock�
_cookies_lock�_cookies�r�policys  rr�CookieJar.__init__�s,���>�(�*�F���'�-�-�/�����
rc��Xlgr")r�r�s  r�
set_policy�CookieJar.set_policy�s���rc��/nURRX5(d/$[SU5 URUnUR	5H�nURRXR5(dM%XEnUR
5HLnURRXr5(d
[S5 M0[S5 URU5 MN M� U$)Nz!Checking %s for cookies to returnz   not returning cookiez   it's a match)	r�rUrr��keysrYr�rQr�)rr�r��cookies�cookies_by_pathr��cookies_by_namerMs        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��/nURR5H#nURURX155 M% U$)z2Return a list of cookies to be returned to server.)r�r�extendr)rr�rr�s    r�_cookies_for_request�CookieJar._cookies_for_request
s:�����m�m�(�(�*�F��N�N�4�3�3�F�D�E�+��rc���URSSS9 Sn/nUGH�nURnU(dSnUS:�aURSU-5 URbWURRUR5(a-US:�a'URRSUR5nOURnURcURUR5 O"URUR<S	U<35 US:�dM�UR(aURS
UR-5 URRS5(aLURnUR(dURS5(aUSSnURS
U-5 URcGM�SnUR(aUSUR--nURU5 GM� U$)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�,�[UR5$r")r�r�)�as r�<lambda>�)CookieJar._cookie_attrs.<locals>.<lambda>s��3�q�v�v�;rT)r��reverseFr
z$Version=%sNr�r�z
$Path="%s"r�r%z$Domain="%s"z$Portz="%s")�sortr�r�r��non_word_rerc�quote_rer�r�rr�r�r�rr�r)	rrr��attrsrMr�r�r�r4s	         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��)�)�#�.�.�!'������L�L��&�!8�9��;�;�*��A��,�,���6�;�;�!6�7���L�L��O�Q�T�rc��[S5 URR5 [[R"55=UR
lUlURU5nURU5nU(a7URS5(d!URSSRU55 UR
R(a^UR
R(dCURS5(d-UH'nURS:wdMURSS5  O URR5 UR!5 g!URR5 f=f)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��Cookie2r%z$Version="1"N)rr��acquirerdrqr�r�rr�
has_header�add_unredirected_headerr�r`rbr��release�clear_expired_cookies)rr�rrrMs     rr�CookieJar.add_cookie_headerLs��	�"�#����"�"�$�	)�,/��	�	��,<�<�D�L�L���	��/�/��8�G��&�&�w�/�E���)�)�(�3�3��3�3� �$�)�)�E�"2�4����$�$�T�\�\�-F�-F��&�&�y�1�1�%�F��~�~��*��7�7�	�>�R��&�
���&�&�(��"�"�$��
���&�&�(�s�C3E�E�E;c�h�/nSnSnUGHnUSupgSnSn	0n
0nUSSH�up�UR5nX�;dX�;aUnX�;aU
cSn
X�;aM2US:Xa"U
c[S	5 Sn	 O�U
R5n
US
:XaU(aMiU
c
[S5 MyUS:XaSn[U
5n
S
nURU
-n
X�;dX�;a!U
cUS;a[SU-5 Sn	 OX�U'M�X�U'M� U	(aM�URXgX�45 GM U$![a [S
5 Sn	 M>f=f)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.

)rr�)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�rr#z!   missing value for %s attribute)rorrdrpr�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_tuplesms����
�+�
�0��
&�L�&�q�/�K�D� �K��J��H��D�$�Q�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�#D�D1�0D1c�v�Uup4pVURS[5nURS[5nURS[5n	URS[5n
URSS5nUb[U5nURSS5nURSS5n
URS	S5nURS
S5nU[LaUS:waSn[	U5nOISn[U5nUR
S
5nUS:waUS:XaUSUnOUSUS-n[U5S:XaS
nU[LnSnU(a[URS55nU[La[U5unnUnOURS5(dSU-nSnU	[La*U	c[U5n	OSn[R"SSU	5n	OSn	U
[LaSn
Sn
O0X�R::a!URXxU5 [#SXxU5 g[%UX4U	UUUUUUUU
U
UUU5$![a gf=f![ a NCf=f)Nr�r�r�r�r�r�Frrr#rTr�r�r
r%r�z\s+z2Expiring cookie, domain='%s', path='%s', name='%s')r'r�rdrpr�r�r�r��boolr�r�rr�r�r��clear�KeyErrorrr)r�tupr�r�r�r+rr�r�r�r�r�r�rrrrr�rrr�r�rs                       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$�4H�"H+�
H(�'H(�+
H8�7H8c��URU5n/nUH.nURXR5nU(dMURU5 M0 U$r")r,r3r�)rr$r�r%rr2rMs       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���[URSS5nUcURR(+nUH,nURS:XdMSUlU(dM%SUlM. g)Nrar%Tr
)r<r�r`r�r)rr�
rfc2109_as_nsrMs    r�_process_rfc2109_cookies�"CookieJar._process_rfc2109_cookies3sX������.C�T�J�
�� � $��� 4� 4�4�M��F��~�~��"�!%��� �=�&'�F�N�
rc��UR5nURS/5nURS/5n[[R"55=URlUlURRnURRnU(dU(a*U(dU(aU(dU(aU(d	U(d/$UR[U5U5nU(a�U(a�UR[U5U5n	URU	5 U(aA0n
UH(nSX�RURUR 4'M* U
4Sjn[#X�5n	U	(aUR%U	5 U$![a [5 /nN�f=f![a [5 /n	N�f=f)zAReturn sequence of Cookie objects extracted from response object.zSet-Cookie2z
Set-CookieNc�P�URURUR4nX!;$r")r�r�r�)�	ns_cookie�lookupr�s   r�no_matching_rfc2965�3CookieJar.make_cookies.<locals>.no_matching_rfc2965ls%��#�*�*�I�N�N�I�N�N�J�C��,�,r)r��get_allrdrqr�r�r`r_r6r��	Exceptionr"r�r:r�r�r��filterr
)
r�responser�r��rfc2965_hdrs�ns_hdrsr`r_r�
ns_cookiesr?rMr@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�:F$�F!� F!�$F=�<F=c�v�URR5 [[R"55=URlUlURR
X5(aURU5 URR5 g!URR5 f=f)z-Set a cookie if policy says it's OK to do so.N)	r�rrdrqr�r�rN�
set_cookierrLs   r�set_cookie_if_ok�CookieJar.set_cookie_if_okvs�����"�"�$�	)�,/��	�	��,<�<�D�L�L���	��|�|�"�"�6�3�3�����'�
���&�&�(��D���&�&�(�s�A%B�B8c��URnURR5 URU;a0X!R'X!RnURU;a0X1R'X1RnXUR
'URR
5 g!URR
5 f=f)z?Set a cookie, without checking whether or not it should be set.N)r�r�rr�r�r�r)rrM�c�c2�c3s     rrL�CookieJar.set_cookie�s����M�M�����"�"�$�	)��}�}�A�%�"�q���'7��=�=�!�B��{�{�"�$��b���o��K�K��B�$�v�{�{�O����&�&�(��D���&�&�(�s�A&B)�)Cc��[SUR55 URR5 UR	X5HBnUR
R
X25(dM%[SU5 URU5 MD URR5 g!URR5 f=f)zAExtract cookies from response, where allowable given the request.zextract_cookies: %sz setting cookie: %sN)	rr�r�rrIr�rNrLr)rrEr�rMs    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���Ub%UbUc[S5eURUUU	gUbUc[S5eURUU	gUbURU	g0Ulg)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)rpr�)rr�r�r�s    rr0�CookieJar.clear�s�������D�L� �N�P�P��
�
�f�%�d�+�D�1�
�
��~� �D�F�F��
�
�f�%�d�+�
�
��
�
�f�%��D�Mrc�F�URR5 UHGnUR(dMURURUR
UR5 MI URR5 g!URR5 f=f)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�rrr0r�r�r�r)rrMs  r�clear_session_cookies�CookieJar.clear_session_cookies�sq��	
���"�"�$�	)����>�>�>��J�J�v�}�}�f�k�k�6�;�;�G��
���&�&�(��D���&�&�(�s�B�5B�B c�z�URR5 [R"5nUHLnURU5(dMUR	UR
URUR5 MN URR5 g!URR5 f=f)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�rrqr0r0r�r�r�r)rrKrMs   rr �CookieJar.clear_expired_cookies�s���	
���"�"�$�	)��)�)�+�C����$�$�S�)�)��J�J�v�}�}�f�k�k�6�;�;�G��
���&�&�(��D���&�&�(�s�.B�5B�B:c�,�[UR5$r")r�r�rqs r�__iter__�CookieJar.__iter__�s���$�-�-�(�(rc�$�SnUHo!S-nM	 U$)z#Return number of contained cookies.r
r%rG)rr�rMs   r�__len__�CookieJar.__len__�s��
���F�A��A�d��rc��/nUHo!R[U55 M SURR<SSR	U5<S3$�N�<�[r�z]>)r�r=r>r?r��r�rrMs   rr@�CookieJar.__repr__�s8�����F�H�H�T�&�\�2�d�!�^�^�4�4�d�i�i��l�C�Crc��/nUHo!R[U55 M SURR<SSR	U5<S3$re)r�r�r>r?r�rhs   rr7�CookieJar.__str__�s8�����F�H�H�S��[�1�d�!�^�^�4�4�d�i�i��l�C�Cr)r�r�r�r�r")NNN)$r?rBrCrDrEr��compilerr�strict_domain_re�	domain_re�dots_re�ASCII�magic_rerrrrrrr,r3r6r:rIrMrLrUr0rZr r_rbr@r7rFrGrrrr�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�
Drrc��\rSrSrSrg)ri�rGNr�rGrrrr�s��$rrc�D�\rSrSrSrS	SjrS
SjrS
SjrS
SjrSr	g)ri�z6CookieJar that can be loaded from and saved to a file.Nc��[RX5 Ub[R"U5nXl[U5Ulg)ze
Cookies are NOT loaded from the named file until either the .load() or
.revert() method is called.

N)rr�os�fspath�filenamer/�	delayload)rrxryr�s    rr�FileCookieJar.__init__�s6��	���4�(����y�y��*�H� �
��i���rc��[5e)zSave cookies to a file.rJ)rrx�ignore_discard�ignore_expiress    r�save�FileCookieJar.save�rSrc���Uc)URb
URnO[[5e[U5nUR	XAX#5 SSS5 g!,(df   g=f)zLoad cookies from a file.N)rxrp�MISSING_FILENAME_TEXT�open�_really_load�rrxr|r}r s     r�load�FileCookieJar.loadsI�����}�}�(�T�]�]�(�"�#8�9�9�
�(�^�q����a�>�J��^�^�s�A�
A"c��Uc)URb
URnO[[5eURR	5 [
R"UR5n0UlURXU5 URR5 g![a X@lef=f!URR5 f=f)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)rxrpr�r�rr�deepcopyr�r��OSErrorr)rrxr|r}�	old_states     r�revert�FileCookieJar.reverts������}�}�(�T�]�]�(�"�#8�9�9����"�"�$�	)��
�
�d�m�m�4�I��D�M�
��	�	�(�N�C�
���&�&�(���
� )�
��
��

���&�&�(�s�'B3�0B�B0�0B3�3C)r�ryrx)NFN�NFF)
r?rBrCrDrErr~r�r�rFrGrrrr�s"��@�
)�$�K�#�49�)rrc�V�URUR4SUR4SUR4/nURbURSUR45 UR(aURS5 UR(aURS5 UR(aURS5 UR(aURS5 UR(a/URS[[UR5545 UR(aURS	5 UR(aURS
UR45 UR(aURSUR45 [!UR"R%55nUH,nURU['UR"U545 M. URS['UR(545 [+U/5$)
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�)�	path_specN)�	port_specN)�
domain_dotN)r�Nr�)rNrr#r�)r�r�r�r�r�r�rrrr�r�rTr�rrr�sortedrrr�r�r�)rMrrr�s    r�lwp_cookie_strr�'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�2�\rSrSrSrSSjrS	SjrSrSrg)
riCa?
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��[R"5n/nUHYnU(dUR(aMU(dURU5(aM<URS[	U5-5 M[ SRUS/-5$)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)rqrr0r�r�r�)rr|r}rKrirMs      r�
as_lwp_str�LWPCookieJar.as_lwp_strPsn���i�i�k�����F�!�f�n�n��!�f�&7�&7��&<�&<��
�H�H�&���)?�?�@���y�y��B�4�� � rNc��Uc)URb
URnO[[5e[R"[R
"U[R[R-[R-S5S5nURS5 URURX#55 SSS5 g!,(df   g=f)N��wz#LWP-Cookies-2.0
)rxrpr�rv�fdopenr��O_CREAT�O_WRONLY�O_TRUNC�writer�r�s     rr~�LWPCookieJar.save`s������}�}�(�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�
Cc��UR5nURRU5(dSU-n[U5e[R"5nSnSn	Sn
UR5=nS:wGa�URU5(dM/U[
U5SR5n[U/5GHWnUSup�0n0nU	HnSUU'M
 USSHNunnUbUR5nOSnUU
;dUU	;aUnUU	;aUcS	nUUU'M<UU
;aUUU'MIUUU'MP URnU"S
5nU"S5nUb[U5nUcS	nU"S5nURS
5n[U"S5X�U"S5U"S5UUU"S5U"S5U"S5U"S5UUU"S5U"S5U5nU(dUR(aGM&U(dURU5(aGMFURU5 GMZ UR5=nS:waGM�gg![ a e["a [%5 [SU<SW<35ef=f)Nz5%r does not look like a Set-Cookie3 (LWP) format filezSet-Cookie3:)r�r�r�r�r)r�r�r�r�r�rr#rr
Fr%Tr�rr�r�r�r�r�r�r�r�r�rr#z invalid Set-Cookie3 format file �: )�readlinerrrcrrqr�r�r�r�ror'r�rrr0rLr�rCr")rr rxr|r}�magicr!rK�headerr&r'�line�datar�r�r+rr�r�r�rr�rr�rrPs                          rr��LWPCookieJar._really_loadosn���
�
����}�}�#�#�E�*�*��$�%�C��C�.� ��i�i�k����.�
�0��
9	.��:�:�<�'�4�B�.����v�.�.���C��K�L�)�/�/�1��.��v�6�D�"&�q�'�K�D�!�H��D�*��&+����+� $�Q�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� �)�a�l�l�3�.?�.?� ��O�O�A�&�[7��:�:�<�'�4�B�.�.��f�	���	.�%�'��%�t�-�.�
.�	.�s
�G	H+�+2IrG)TTr�)	r?rBrCrDrEr�r~r�rFrGrrrrCs��
�!� 
E�J.rrc�(�\rSrSrSrSrSSjrSrg)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���[R"5n[RUR55(d[	SU-5eUR5=nS:wGaQ0nUR[5(aSU['U[[5SnURS5(aUSSnUR5RS5(dUR5S:XaM�URS5up�p�p�nUS:HnU	S:Hn	U
S:XaUn
SnURS5nS	nUS:XaSnS
n[SX�SS	X�UU
S	UUUSSU5nU(dUR(aGMU(dURU5(aGM=URU5 UR5=nS:waGMPgg![ a e["a [%5 [	SU<S
W<35ef=f)Nz4%r does not look like a Netscape format cookies filerr�r�)�#r��	�TRUEr�FTr
z%invalid Netscape format cookies file r�)rq�NETSCAPE_MAGIC_RGXr�r�rr��HTTPONLY_PREFIX�
HTTPONLY_ATTRr�r�r�r�rrr0rLr�rCr")rr rxr|r}rKr�rr�rr�r�r�r�r�r�rrPs                  rr��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�� ���b�=�"�G�"�G��1�d���!�[���!�"�"����	!��&�!�)�)��%�!�,�,�s�*;�*;������"�i�:�:�<�'�4�B�.�.��l�	���	.�%�'��%�t�-�.�
.�	.�s
�
E$F6�62G(Nc
��Uc)URb
URnO[[5e[R"[R
"U[R[R-[R-S5S5nUR[5 [R"5nUGH'nURnU(dUR(aM*U(dURU5(aMIUR(aSnOSnUR!S5(aSn	OSn	UR"b[%UR"5n
OSn
UR&cSnUR(nOUR(nUR&nUR+[,5(a	[.U-nURSR1XyUR2X�X�/5S-5 GM* SSS5 g!,(df   g=f)	Nr�r�r��FALSEr�rr�r�)rxrpr�rvr�r�r�r�r�r��NETSCAPE_HEADER_TEXTrqr�rr0r�r�r�r�r�r�r$r�r�r�r�)
rrxr|r}r rKrMr�r�r�r�r�r�s
             rr~�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�

�
�
�s
�
EG,�,
G:rGr�)r?rBrCrDrEr�r~rFrGrrr	r	�s���>D.�L'rr	r")YrE�__all__rvrrJr�rq�urllib.parser��urllib.request�	threadingr��http.client�http�calendarrr
rrr�r�r��client�	HTTP_PORTrrmr�r�r�r"r+r3rVrXrormrTrYrarqrbrhr{r��Ir��Xr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�r
rrrrr�r�rr�rrr�rr	)r.s0r�<module>r�s����6M��
���	��#����
��	
����
�������-�-�.���Z�Z� @�A��:����A��
��9��
4��+1�2�6�%���
�6�2��B�&0�(��T��=�	��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�
�
�;�/���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��A;3s�J4

?>