B
Lj+ @ s d Z ddddddddgZd d
lZd d
lZd d
lZd d
lZd d
lZd d
lZd d
l Z
d d
lZd dl
mZ dZd
ad
d ZeejjZdZdd ZdZdd ZdddddddgZddddd d!d"d#d$d%d&d'gZg ZxeD ]Zee qW dud(d)Z dvd*d+Z!d
d
d
d
d,Z"e#d-ej$Z%d.d/ Z&d0d1 Z'e#d2ej$Z(e#d3ej)ej$B Z*e#d4ej+ej$B Z,d5d6 Z-e#d7ej+ej$B Z.d8d9 Z/d:d; Z0e#d<Z1e#d=Z2e#d>Z3e#d?Z4d@dA Z5e#dBZ6dCdD Z7dEdF Z8dGdH Z9e#dIej$Z:dJdK Z;dLdM Z<dNdO Z=dPdQ Z>e#dRej$Z?dSdT Z@dUdV ZAdWdX ZBdYdZ ZCd[ZDe#d\ZEd]d^ ZFd_d` ZGdadb ZHdcdd ZIG ded dZJG dfd dZKG dgd deKZLdhdi ZMdjdk ZNG dldm dmZOG dnd dZPG dod deQZRG dpd dePZSdqdr ZTG dsd deSZUG dtd deSZVd
S )wa 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 CookieJarCookiePolicyDefaultCookiePolicy
FileCookieJarLWPCookieJar LoadErrorMozillaCookieJar N)timegmFc G s( t sd S tsdd l}|datj | S )Nr zhttp.cookiejar)debugloggerloggingZ getLogger)argsr
r 3/opt/alt/python37/lib64/python3.7/http/cookiejar.py_debug+ s
r zQa filename was not supplied (nor was the CookieJar instance initialised with one)c C sJ dd l } dd l}dd l}| }|d | | }|jd| dd d S )Nr zhttp.cookiejar bug!
%s )
stacklevel)iowarnings tracebackStringIO print_excgetvaluewarn)r r r fmsgr r r _warn_unhandled_exception9 s
r i c C s | d d \}}}}}}|t krd| kr4dkrn nhd| krLdkrn nPd| krddkrn n8d| kr|dkrn n d| krdkrn nt| S d S d S ) N r ; = )
EPOCH_YEARr
)ttyearmonthZmdayhourminsecr r r _timegmH s
8Hr, ZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecc C s@ | dkrt j }nt j | }d|j|j|j|j|j|jf S )aH 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 "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'