JFIF  x x C         C     "        } !1AQa "q2 #B R $3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz        w !1AQ aq"2 B #3R br $4 % &'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz   ?  N m? j EP ó Åßjc@sWdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZyddlmZWn!ek råddlmZnXyddlZWnek reZnXeZddlmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$ddlm%Z%m&Z&m'Z'm(Z(e j)d Z*da,de j-ddedd„Z.d„Z/d e0fd „ƒYZ1d e1efd „ƒYZ2ej3d ƒZ4d„Z5ddDd„ƒYZ6ddEd„ƒYZ7d„Z8ddFd„ƒYZ9de9fd„ƒYZ:de9fd„ƒYZ;de9fd„ƒYZ<d„Z=de9fd„ƒYZ>ddGd „ƒYZ?d!e?fd"„ƒYZ@d#dHd$„ƒYZAd%eAe9fd&„ƒYZBd'eAe9fd(„ƒYZCd)„ZDd*dId+„ƒYZEd,e9eEfd-„ƒYZFd.e9eEfd/„ƒYZGd0e9fd1„ƒYZHd2eHfd3„ƒYZIeJed4ƒrÊd5eHfd6„ƒYZKnd7e9fd8„ƒYZLd9e9fd:„ƒYZMd;„ZNd<„ZOd=„ZPd>e9fd?„ƒYZQd@e9fdA„ƒYZRdBeRfdC„ƒYZSdS(Js! An extensible library for opening URLs using a variety of protocols The simplest way to use this module is to call the urlopen function, which accepts a string containing a URL or a Request object (described below). It opens the URL and returns the results as file-like object; the returned object has some extra methods described below. The OpenerDirector manages a collection of Handler objects that do all the actual work. Each Handler implements a particular protocol or option. The OpenerDirector is a composite object that invokes the Handlers needed to open the requested URL. For example, the HTTPHandler performs HTTP GET and POST requests and deals with non-error returns. The HTTPRedirectHandler automatically deals with HTTP 301, 302, 303 and 307 redirect errors, and the HTTPDigestAuthHandler deals with digest authentication. urlopen(url, data=None) -- Basic usage is the same as original urllib. pass the url and optionally data to post to an HTTP URL, and get a file-like object back. One difference is that you can also pass a Request instance instead of URL. Raises a URLError (subclass of IOError); for HTTP errors, raises an HTTPError, which can also be treated as a valid response. build_opener -- Function that creates a new OpenerDirector instance. Will install the default handlers. Accepts one or more Handlers as arguments, either instances or Handler classes that it will instantiate. If one of the argument is a subclass of the default handler, the argument will be installed instead of the default. install_opener -- Installs a new opener as the default opener. objects of interest: OpenerDirector -- Sets up the User Agent as the Python-urllib client and manages the Handler classes, while dealing with requests and responses. Request -- An object that encapsulates the state of a request. The state can be as simple as the URL. It can also include extra HTTP headers, e.g. a User-Agent. BaseHandler -- exceptions: URLError -- A subclass of IOError, individual protocols have their own specific subclass. HTTPError -- Also a valid HTTP response, so you can treat an HTTP error as an exceptional event or valid response. internals: BaseHandler and parent _call_chain conventions Example usage: import urllib2 # set up authentication info authinfo = urllib2.HTTPBasicAuthHandler() authinfo.add_password(realm='PDQ Application', uri='https://mahler:8092/site-updates.py', user='klem', passwd='geheim$parole') proxy_support = urllib2.ProxyHandler({"http" : "http://ahad-haam:3128"}) # build a new opener that adds authentication and caching FTP handlers opener = urllib2.build_opener(proxy_support, authinfo, urllib2.CacheFTPHandler) # install it urllib2.install_opener(opener) f = urllib2.urlopen('http://www.python.org/') iÿÿÿÿN(tStringIO(tunwraptunquotet splittypet splithosttquotet addinfourlt splitporttsplittagttoBytest splitattrt ftpwrappert splitusert splitpasswdt splitvalue(t localhostt url2pathnamet getproxiest proxy_bypassic CsÝ|s|s|r„|dk r-tdƒ‚ntsBtdƒ‚ntjdtjjd|d|ƒ}td|ƒ}t|ƒ}nF|r¨td|ƒ}t|ƒ}n"t dkrÄtƒa }nt }|j |||ƒS(NsDYou can't pass both context and any of cafile, capath, and cadefaultsSSL support not availabletpurposetcafiletcapathtcontext( tNonet ValueErrort _have_ssltssltcreate_default_contexttPurposet SERVER_AUTHt HTTPSHandlert build_openert_openertopen( turltdatattimeoutRRt cadefaultRt https_handlertopener((s,/opt/alt/python27/lib64/python2.7/urllib2.pyturlopenƒs$    cCs |adS(N(R (R'((s,/opt/alt/python27/lib64/python2.7/urllib2.pytinstall_openerœstURLErrorcBseZd„Zd„ZRS(cCs|f|_||_dS(N(targstreason(tselfR,((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt__init__ªs cCs d|jS(Ns(R,(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt__str__®s(t__name__t __module__R.R/(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR*¤s t HTTPErrorcBsAeZdZejZd„Zd„Zed„ƒZd„Z RS(sBRaised when HTTP error occurs, but also acts like non-error returncCsV||_||_||_||_||_|dk rR|j||||ƒndS(N(tcodetmsgthdrstfptfilenameRt_HTTPError__super_init(R-R"R3R4R5R6((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR.µs      cCsd|j|jfS(NsHTTP Error %s: %s(R3R4(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR/ÂscCs|jS(N(R4(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR,ÇscCs|jS(N(R5(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pytinfoËs( R0R1t__doc__RR.R8R/tpropertyR,R9(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR2±s   s:\d+$cCs_|jƒ}tj|ƒd}|dkr@|jddƒ}ntjd|dƒ}|jƒS(sˆReturn request-host, as defined by RFC 2965. Variation from RFC: returned value is lowercased, for convenient comparison. ittHost(t get_full_urlturlparset get_headert _cut_port_retsubtlower(trequestR"thost((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt request_hostÐs   tRequestcBsÂeZdided„Zd„Zd„Zd„Zd„Zd„Z d„Z d„Z d„Z d „Z d „Zd „Zd „Zd „Zd„Zd„Zd„Zdd„Zd„ZRS(cCsÇt|ƒ|_t|jƒ\|_|_d|_d|_d|_d|_||_ i|_ x*|j ƒD]\}}|j ||ƒqmWi|_ |dkr±t|ƒ}n||_||_dS(N(Rt_Request__originalRt_Request__fragmentRttypeREtportt _tunnel_hostR#theaderstitemst add_headertunredirected_hdrsRFtorigin_req_hostt unverifiable(R-R"R#RMRQRRtkeytvalue((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR.âs         cCs<|dkr/t|d|dƒƒ|j|St|‚dS(Nt_Request__r_typet_Request__r_hosttget_i (RURV(tgetattrt__dict__tAttributeError(R-tattr((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt __getattr__ös  cCs|jƒrdSdSdS(NtPOSTtGET(thas_data(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt get_methods cCs ||_dS(N(R#(R-R#((s,/opt/alt/python27/lib64/python2.7/urllib2.pytadd_datascCs |jdk S(N(R#R(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR_ scCs|jS(N(R#(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pytget_datascCs(|jrd|j|jfS|jSdS(Ns%s#%s(RIRH(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR>s cCsV|jdkrOt|jƒ\|_|_|jdkrOtd|j‚qOn|jS(Nsunknown url type: %s(RJRRRHRUR(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pytget_types cCsR|jdkrKt|jƒ\|_|_|jrKt|jƒ|_qKn|jS(N(RERRRURVR(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pytget_hosts  cCs|jS(N(RV(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt get_selector%scCsJ|jdkr(|j r(|j|_n||_|j|_||_dS(Nthttps(RJRLRERHRV(R-RERJ((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt set_proxy(s   cCs|j|jkS(N(RVRH(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt has_proxy1scCs|jS(N(RQ(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pytget_origin_req_host4scCs|jS(N(RR(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pytis_unverifiable7scCs||j|jƒscCs||jkp||jkS(N(RMRP(R-t header_name((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt has_headerBscCs"|jj||jj||ƒƒS(N(RMtgetRP(R-Rntdefault((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR@Fs cCs)|jjƒ}|j|jƒ|jƒS(N(RPtcopytupdateRMRN(R-R5((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt header_itemsKsN(R0R1RtFalseR.R\R`RaR_RbR>RcRdReRgRhRiRjRORmRoR@Rt(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRGàs(               tOpenerDirectorcBsSeZd„Zd„Zd„Zd„Zdejd„Z dd„Z d„Z RS(cCsMdt}d|fg|_g|_i|_i|_i|_i|_dS(NsPython-urllib/%ss User-agent(t __version__t addheadersthandlerst handle_opent handle_errortprocess_responsetprocess_request(R-tclient_version((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR.Qs     c CsÃt|dƒs(tdt|ƒƒ‚nt}xet|ƒD]W}|d krSq;n|jdƒ}|| }||d}|jdƒr÷|jdƒ|d}||d}yt|ƒ}Wntk rÑnX|j j |iƒ} | |j |(R-R§R6R3R4R5((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR®+s(R0R1R®(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR½*sR¾cBs:eZdZdZd„Zd„ZeZZZdZ RS(ii c Cs±|jƒ}|dkr$|dks<|dkr�|dkr�|jdd ƒ}td „|jjƒDƒƒ}t|d |d |jƒd tƒSt|j ƒ||||ƒ‚dS(s­Return a Request or None in response to a redirect. This is called by the http_error_30x methods when a redirection response is received. If a redirection should take place, return a new Request to allow http_error_30x to perform the redirect. Otherwise, raise HTTPError if no-one else should try to handle this url. Return None if you can't but another Handler might. i-i.i/i3R^tHEADR]t s%20css3|])\}}|jƒdkr||fVqdS(scontent-lengths content-typeN(scontent-lengths content-type(RC(t.0tktv((s,/opt/alt/python27/lib64/python2.7/urllib2.pys Js RMRQRRN(i-i.i/i3(R^RÓ(i-i.i/( R`treplaceR°RMRNRGRiR�R2R>( R-R§R6R3R4RMtnewurltmt newheaders((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR€6s   c Cs d|kr"|jdƒd}n&d|krD|jdƒd}ndStj|ƒ}|j rƒ|jrƒt|ƒ}d|dRCRŠR2R€RR†RßRpt max_repeatstlentmax_redirectionstinf_msgtreadR›RÍR!R$( R-R§R6R3R4RMRÙturlpartst newurl_lowertnewtvisited((s,/opt/alt/python27/lib64/python2.7/urllib2.pythttp_error_302XsB         soThe HTTP server returned a redirect error that would lead to an infinite loop. The last 30x error message was: ( R0R1RæRèR€Rïthttp_error_301thttp_error_303thttp_error_307Ré(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR¾.s  " 8c CsÓt|ƒ\}}|jdƒs0d}|}nV|jdƒsRtd|ƒ‚n|jddƒ}|dkryd}n|d|!}t|ƒ\}}|dk r¹t|ƒ\}}n d}}||||fS(s3Return (scheme, user, password, host/port) given a URL or an authority. If a URL is supplied, it must have an authority (host:port) component. According to RFC 3986, having an authority component means the URL must have two slashes after the scheme: >>> _parse_proxy('file:/ftp.example.com/') Traceback (most recent call last): ValueError: proxy URL with no authority: 'file:/ftp.example.com/' The first three items of the returned tuple may be None. Examples of authority parsing: >>> _parse_proxy('proxy.example.com') (None, None, None, 'proxy.example.com') >>> _parse_proxy('proxy.example.com:3128') (None, None, None, 'proxy.example.com:3128') The authority component may optionally include userinfo (assumed to be username:password): >>> _parse_proxy('joe:password@proxy.example.com') (None, 'joe', 'password', 'proxy.example.com') >>> _parse_proxy('joe:password@proxy.example.com:3128') (None, 'joe', 'password', 'proxy.example.com:3128') Same examples, but with URLs instead: >>> _parse_proxy('http://proxy.example.com/') ('http', None, None, 'proxy.example.com') >>> _parse_proxy('http://proxy.example.com:3128/') ('http', None, None, 'proxy.example.com:3128') >>> _parse_proxy('http://joe:password@proxy.example.com/') ('http', 'joe', 'password', 'proxy.example.com') >>> _parse_proxy('http://joe:password@proxy.example.com:3128') ('http', 'joe', 'password', 'proxy.example.com:3128') Everything after the authority is ignored: >>> _parse_proxy('ftp://joe:password@proxy.example.com/rubbish:3128') ('ftp', 'joe', 'password', 'proxy.example.com') Test for no trailing '/' case: >>> _parse_proxy('http://joe:password@proxy.example.com') ('http', 'joe', 'password', 'proxy.example.com') RÞs//sproxy URL with no authority: %riiÿÿÿÿN(RRŠRRR‰R R ( tproxytschemetr_schemet authoritytendtuserinfothostporttusertpassword((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt _parse_proxy—s2      RºcBs#eZdZdd„Zd„ZRS(idcCs€|dkrtƒ}nt|dƒs3tdƒ‚||_x=|jƒD]/\}}t|d||||jd„ƒqIWdS(Nthas_keysproxies must be a mappings%s_opencSs||||ƒS(N((trRóRJR“((s,/opt/alt/python27/lib64/python2.7/urllib2.pytês(RRR†tAssertionErrortproxiesRNtsetattrR‚(R-RRJR"((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR.ãs    c Cs|jƒ}t|ƒ\}}}}|dkr9|}n|jƒ|jr_t|jƒr_dS|r³|r³dt|ƒt|ƒf} tj| ƒj ƒ} |j dd| ƒnt|ƒ}|j ||ƒ||ksç|dkrëdS|j j |d|jƒSdS(Ns%s:%ssProxy-authorizationsBasic RfR$(RcRüRRdRERRtbase64t b64encodetstripRORgRÍR!R$( R-R§RóRJt orig_typet proxy_typeRúRûRùt user_passtcreds((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR‚ís       N(R0R1RÎRR.R‚(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRºßs tHTTPPasswordMgrcBsMeZd„Zd„Zd„Zed„Zed„Zd„Zd„Z RS(cCs i|_dS(N(tpasswd(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR.scCs—t|tƒr|g}n||jkr:i|j|scCsP|ddk r8|ddk r8|d|dkr8tS|j|d|dƒS(Nii(RRut is_suburi(R-tbasettest((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRCs cCsi||krtS|d|dkr(tStj|d|dfƒ}t|ƒt|dƒkretStS(scCheck if test is below base in a URI tree Both args must be URIs in reduced form. ii(R�Rut posixpatht commonprefixRç(R-R R!tcommon((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRIs ( R0R1R.RRR�RR RR(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR  s    tHTTPPasswordMgrWithDefaultRealmcBseZd„ZRS(cCsDtj|||ƒ\}}|dk r1||fStj|d|ƒS(N(R RR(R-RRRúRû((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRZs    (R0R1R(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR%XstAbstractBasicAuthHandlercBs;eZejdejƒZdd„Zd„Zd„Z RS(s1(?:^|,)[ ]*([^ ,]+)[ ]+realm=(["']?)([^"']*)\2cCs4|dkrtƒ}n||_|jj|_dS(N(RR R R(R-t password_mgr((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR.ws   c Cs–|j|dƒ}|r’tjj|ƒ}|r’|jƒ\}}}|dkrgtjdtdƒn|j ƒdkr�|j |||ƒSq’ndS(Nt"t'sBasic Auth Realm was unquoteditbasic(R(R)( RpRR&trxtsearchtgroupstwarningstwarnt UserWarningRCtretry_http_basic_auth( R-tauthreqRER§RMtmoRôRR((s,/opt/alt/python27/lib64/python2.7/urllib2.pythttp_error_auth_reqed~s   cCs£|jj||ƒ\}}|dk r›d||f}dtj|ƒjƒ}|j|jdƒ|krodS|j|j|ƒ|j j |d|j ƒSdSdS(Ns%s:%ssBasic %sR$( R RRRRRR@t auth_headerRmRÍR!R$(R-RER§RRútpwtrawtauth((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR1Žs N( R0R1tretcompiletIR+RR.R4R1(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR&bs     tHTTPBasicAuthHandlercBseZdZd„ZRS(t AuthorizationcCs(|jƒ}|jd|||ƒ}|S(Nswww-authenticate(R>R4(R-R§R6R3R4RMR"R…((s,/opt/alt/python27/lib64/python2.7/urllib2.pythttp_error_401Ÿs  (R0R1R5R>(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR<›stProxyBasicAuthHandlercBseZdZd„ZRS(sProxy-authorizationcCs(|jƒ}|jd|||ƒ}|S(Nsproxy-authenticate(RdR4(R-R§R6R3R4RMRöR…((s,/opt/alt/python27/lib64/python2.7/urllib2.pythttp_error_407ªs  (R0R1R5R@(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR?¦scCs}tjjdƒr;tdƒ}|j|ƒ}|jƒ|Sgt|ƒD]}ttj ddƒƒ^qH}dj |ƒSdS(sReturn n random bytes.s /dev/urandomiiR<N( tosRátexistsR!RêR›trangetchrtrandomt randrangetjoin(tntftsR”tL((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt randombytesµs  1tAbstractDigestAuthHandlercBsSeZdd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z RS( cCsO|dkrtƒ}n||_|jj|_d|_d|_d|_dS(Ni(RR R Rtretriedt nonce_countt last_nonce(R-R ((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR.Îs     cCs d|_dS(Ni(RN(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pytreset_retry_count×scCs�|j|dƒ}|jdkrBt|jƒdd|dƒ‚n|jd7_|rŒ|jƒd}|jƒdkrŒ|j||ƒSndS(Nii‘sdigest auth failediitdigest(RpRRNR2R>tsplitRCtretry_http_digest_auth(R-R5RER§RMR2Rô((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR4ÚscCs¤|jddƒ\}}tt|ƒƒ}|j||ƒ}|r d|}|jj|jdƒ|krndS|j|j|ƒ|j j |d|j ƒ}|SdS(NRÔis Digest %sR$( RStparse_keqv_listtparse_http_listtget_authorizationRMRpR5RRmRÍR!R$(R-R§R8ttokent challengetchaltauth_valtresp((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRTës cCs<tjd|j|tjƒtdƒfƒjƒ}|d S(Ns %s:%s:%s:%sii(thashlibtsha1ROttimetctimeRLt hexdigest(R-tnoncetdig((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt get_cnonce÷scCsdyK|d}|d}|jdƒ}|jddƒ}|jddƒ}Wntk r_dSX|j|ƒ\}} |dkr…dS|jj||jƒƒ\} } | dkr¶dS|jƒrÝ|j|j ƒ|ƒ} nd} d| || f} d|j ƒ|j ƒf}|d kr¤||j kr?|j d 7_ nd |_ ||_ d |j }|j|ƒ}d ||||||ƒf}| || ƒ|ƒ}nD|dkrØ| || ƒd|||ƒfƒ}ntd |ƒ‚d| |||j ƒ|f}|r|d|7}n| r5|d| 7}n|d|7}|r`|d||f7}n|S(NRRbtqopt algorithmtMD5topaques%s:%s:%ss%s:%sR8is%08xs%s:%s:%s:%s:%ssqop '%s' is not supported.s>username="%s", realm="%s", nonce="%s", uri="%s", response="%s"s , opaque="%s"s , digest="%s"s, algorithm="%s"s, qop=auth, nc=%s, cnonce="%s"(RpRtKeyErrortget_algorithm_implsR RR>R_tget_entity_digestRbR`ReRPRORdR*(R-R§RZRRbReRfRhtHtKDRúR6tentdigtA1tA2tncvaluetcnoncetnoncebittrespdigR ((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRWsV    !        ( csk|jƒ}|dkr$d„‰n.|dkr<d„‰ntd|jƒƒ‚‡fd†}ˆ|fS(NRgcSstj|ƒjƒS(N(R]tmd5Ra(tx((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRÿCR<tSHAcSstj|ƒjƒS(N(R]R^Ra(Rv((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRÿER<s.Unsupported digest authentication algorithm %rcsˆd||fƒS(Ns%s:%s((RJtd(Rl(s,/opt/alt/python27/lib64/python2.7/urllib2.pyRÿJR<(tupperRRC(R-RfRm((Rls,/opt/alt/python27/lib64/python2.7/urllib2.pyRj>s     cCsdS(N(R(R-R#RZ((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRkMsN( R0R1RR.RQR4RTRdRWRjRk(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRMÃs   = tHTTPDigestAuthHandlercBs#eZdZdZdZd„ZRS(s¨An authentication protocol defined by RFC 2069 Digest authentication improves on basic authentication because it does not transmit passwords in the clear. R=iêcCs?tj|jƒƒd}|jd|||ƒ}|jƒ|S(Niswww-authenticate(R?R>R4RQ(R-R§R6R3R4RMREtretry((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR>\s   (R0R1R:R5RÎR>(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRzRstProxyDigestAuthHandlercBseZdZdZd„ZRS(sProxy-AuthorizationiêcCs2|jƒ}|jd|||ƒ}|jƒ|S(Nsproxy-authenticate(RdR4RQ(R-R§R6R3R4RMRER{((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR@is    (R0R1R5RÎR@(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR|dstAbstractHTTPHandlercBs/eZdd„Zd„Zd„Zd„ZRS(icCs ||_dS(N(t _debuglevel(R-t debuglevel((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR.rscCs ||_dS(N(R~(R-tlevel((s,/opt/alt/python27/lib64/python2.7/urllib2.pytset_http_debuglevelusc Cs:|jƒ}|s!tdƒ‚n|jƒrŠ|jƒ}|jdƒs[|jddƒn|jdƒsŠ|jddt|ƒƒqŠn|}|jƒrÉt|j ƒƒ\}}t |ƒ\}}n|jdƒsë|jd|ƒnxH|j j D]:\}} |j ƒ}|j|ƒsø|j|| ƒqøqøW|S(Ns no host givens Content-types!application/x-www-form-urlencodedsContent-lengths%dR=(RdR*R_RbRoRmRçRhRReRRÍRxRk( R-RDRER#tsel_hostRôtseltsel_pathtnameRT((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt do_request_xs.      c  sâ|jƒ}|s!tdƒ‚n||d|j|�}|j|jƒt|jƒ‰ˆjt‡fd†|jj ƒDƒƒƒdˆd¨s R›t Connectioncss'|]\}}|jƒ|fVqdS(N(ttitle(RÕR…Rl((s,/opt/alt/python27/lib64/python2.7/urllib2.pys ³ssProxy-AuthorizationRMt buffering(RdR*R$tset_debuglevelR~R°RPRsRMRNRLt set_tunnelRDR`ReR#R³R„R›t getresponseR�R‡Rêtrecvt _fileobjectRR4R>tstatusR3R,( R-t http_classR§thttp_conn_argsRERËttunnel_headerstproxy_auth_hdrterrRþR6R\((RMs,/opt/alt/python27/lib64/python2.7/urllib2.pyR�•s@ ,    )     (R0R1R.R�R†R�(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR}ps   R¼cBseZd„ZejZRS(cCs|jtj|ƒS(N(R�RÂtHTTPConnection(R-R§((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt http_openàs(R0R1R–R}R†t http_request(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR¼Þs R¹RcBs)eZddd„Zd„ZejZRS(icCstj||ƒ||_dS(N(R}R.t_context(R-RR((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR.èscCs|jtj|d|jƒS(NR(R�RÂtHTTPSConnectionR˜(R-R§((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt https_openìsN(R0R1RR.RšR}R†t https_request(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRæs tHTTPCookieProcessorcBs2eZdd„Zd„Zd„ZeZeZRS(cCs4ddl}|dkr'|jƒ}n||_dS(Niÿÿÿÿ(t cookielibRt CookieJart cookiejar(R-RŸR�((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR.ós  cCs|jj|ƒ|S(N(RŸtadd_cookie_header(R-RD((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR—ùscCs|jj||ƒ|S(N(RŸtextract_cookies(R-RDR…((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRÑýsN(R0R1RR.R—RÑR›RÒ(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRœòs    R»cBseZd„ZRS(cCs |jƒ}td|ƒ‚dS(Nsunknown url type: %s(RcR*(R-R§RJ((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR«s (R0R1R«(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR»scCsmi}x`|D]X}|jddƒ\}}|ddkr[|ddkr[|dd!}n|||Parse list of key=value strings where keys are not duplicated.t=iiR(iÿÿÿÿ(RS(tltparsedteltRÖR×((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRU s  cCsýg}d}t}}x±|D]©}|r?||7}t}qn|r‚|dkr]t}qn|dkrrt}n||7}qn|dkr§|j|ƒd}qn|dkr¼t}n||7}qW|rà|j|ƒng|D]}|jƒ^qçS(spParse lists as described by RFC 2068 Section 2. In particular, parse comma-separated lists where the elements of the list may include quoted-strings. A quoted-string could contain a comma. A non-quoted string could have quotes in the middle. Neither commas nor quotes count if they are escaped. Only double-quotes count, not single-quotes. R<s\R(t,(RuR�R�R(RJtrestparttescapeRtcur((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRVs4            cCs-ytj|ƒSWntjk r(dSXdS(N(R³t gethostbynametgaierrorR(RE((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt_safe_gethostbyname>sRÀcBs)eZd„ZdZd„Zd„ZRS(cCsq|jƒ}|d dkr`|dd!dkr`|jr`|jdkr`d|_|jj|ƒS|j|ƒSdS(Nis//iRÞRtftp(ReRERJRÍR!topen_local_file(R-R§R"((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt file_openFs  , cCs|tjdkruy7ttjdƒdtjtjƒƒdƒt_Wqutjk rqtjdƒft_quXntjS(NRi( RÀtnamesRR R³tgethostbyname_ext gethostnameR¬R«(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt get_namesQs$cCs[ddl}ddl}|jƒ}|jƒ}t|ƒ}yítj|ƒ}|j}|jj |j dt ƒ} |j |ƒd} t jtd| pšd|| fƒƒ} |rÈt|ƒ\}} n| sî| r(t|ƒ|jƒkr(|rd||} n d|} tt|dƒ| | ƒSWntk rJ}t|ƒ‚nXtdƒ‚dS( Niÿÿÿÿtusegmtis6Content-type: %s Content-length: %d Last-modified: %s s text/plainsfile://trbsfile not on local host(t email.utilst mimetypesRdReRRAtstattst_sizetutilst formatdatetst_mtimeR�t guess_typet mimetoolstMessageRRR­R´RR!tOSErrorR*(R-R§temailR¸RER7t localfiletstatstsizetmodifiedtmtypeRMRKtorigurlR4((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR¯\s0        N(R0R1R°RR±R´R¯(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRÀDs  R¿cBseZd„Zd„ZRS(cCsÍddl}ddl}|jƒ}|s9tdƒ‚nt|ƒ\}}|dkrc|j}n t|ƒ}t|ƒ\}}|rœt |ƒ\}}nd}t |ƒ}|p·d}|pÃd}yt j |ƒ}Wn"t j k rý}t|ƒ‚nXt|jƒƒ\} } | jdƒ} tt | ƒ} | d | d} } | rg| d rg| d} ny/|j||||| |jƒ} | r—dpšd}xM| D]E}t|ƒ\}}|jƒd kr¤|dkr¤|jƒ}q¤q¤W| j| |ƒ\}}d}|j|jƒƒd}|r;|d|7}n|dk rd|dkrd|d|7}nt|ƒ}tj|ƒ}t|||jƒƒSWn0|jk rÈ}td|tj ƒd‚nXdS(Niÿÿÿÿsftp error: no host givenR<RÞiiR;tDRJtatAR”RxsContent-type: %s sContent-length: %d s ftp error: %si(RÊRËR”R;RxRÉ(!tftplibR¸RdR*RRtFTP_PORTR‹R R RR³R«R„R ReRStmapt connect_ftpR$RRCRytretrfileR¾R>RR¿RÀRt all_errorstsystexc_info(R-R§RÌR¸RERKRúR R4RátattrstdirstfiletfwRJR[RTR6tretrlenRMRÇtsf((s,/opt/alt/python27/lib64/python2.7/urllib2.pytftp_openys\          !   c Cs%t||||||dtƒ}|S(Nt persistent(R Ru(R-RúR RERKRÕR$R×((s,/opt/alt/python27/lib64/python2.7/urllib2.pyRÏ®s (R0R1RÚRÏ(((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR¿xs 5tCacheFTPHandlercBs>eZd„Zd„Zd„Zd„Zd„Zd„ZRS(cCs1i|_i|_d|_d|_d|_dS(Nii<i(tcacheR$tsoonesttdelayt max_conns(R-((s,/opt/alt/python27/lib64/python2.7/urllib2.pyR.·s     cCs ||_dS(N(Rß(R-tt((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt setTimeout¾scCs ||_dS(N(Rà(R-RÚ((s,/opt/alt/python27/lib64/python2.7/urllib2.pyt setMaxConnsÁscCs›|||dj|ƒ|f}||jkrJtjƒ|j|j|Ls€                 ^"     p� 'i H-L 9  � n  + 4<