etSrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK r SSK r SSK r SSK r SSK r SSKrSSKrSSKrSSKJrJrJr SSKJrJrJrJrJrJrJrJrJrJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r' SSK(J)r)J*r* SSK+r+Sr,/SQr.S \ R^SS -r0Sq1S\ Rd4SS .S jjr3S r4/r5SgSjr6Sr7\ Rp"S\ Rr5r:Sr;"SS5r<"SS5r=Sr>"SS5r?"SS\?5r@"SS\?5rA"SS\?5rBSrC"S S!\?5rD"S"S#5rE"S$S%\E5rF"S&S'\F5rG"S(S)5rH"S*S+\H\?5rI"S,S-\H\?5rJ\RrL"S.S/5rM"S0S1\?\M5rN"S2S3\?\M5rO"S4S5\?5rP"S6S7\P5rQ\R"\RS85(a"S9S:\P5rT\.RS:5 "S;S<\?5rV"S=S>\?5rWS?rXS@rY"SASB\?5rZSCr["SDSE\?5r\"SFSG\\5r]"SHSI\?5r^SJr_\RSK:Xa SSLKaJbrbJcrc OSMrbSNrc0rd"SOSP5re"SQSR\e5rfSqgSSrhSqiSTrjSqkSUrlSqmSVrn"SWSX5roSYrpShSZjrqS[rrS\rs\ RS]:XaSS^KuJvrvJwrw S_rxS`rySarzSbr{g\RSK:Xa Scr|Sdr{Ser}Sfrzg\pr{\qrzg!\-a Sr,GNef=f)ia 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, 307, and 308 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 OSError); 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 -- internals: BaseHandler and parent _call_chain conventions Example usage: import urllib.request # set up authentication info authinfo = urllib.request.HTTPBasicAuthHandler() authinfo.add_password(realm='PDQ Application', uri='https://mahler:8092/site-updates.py', user='klem', passwd='geheim$parole') proxy_support = urllib.request.ProxyHandler({"http" : "http://ahad-haam:3128"}) # build a new opener that adds authentication and caching FTP handlers opener = urllib.request.build_opener(proxy_support, authinfo, urllib.request.CacheFTPHandler) # install it urllib.request.install_opener(opener) f = urllib.request.urlopen('https://www.python.org/') N)URLError HTTPErrorContentTooShortError)urlparseurlspliturljoinunwrapquoteunquote _splittype _splithost _splitport _splituser _splitpasswd _splitattr _splitquery _splitvalue _splittag _to_bytesunquote_to_bytes urlunparse) addinfourl addclosehookTF)!RequestOpenerDirector BaseHandlerHTTPDefaultErrorHandlerHTTPRedirectHandlerHTTPCookieProcessor ProxyHandlerHTTPPasswordMgrHTTPPasswordMgrWithDefaultRealmHTTPPasswordMgrWithPriorAuthAbstractBasicAuthHandlerHTTPBasicAuthHandlerProxyBasicAuthHandlerAbstractDigestAuthHandlerHTTPDigestAuthHandlerProxyDigestAuthHandler HTTPHandler FileHandler FTPHandlerCacheFTPHandler DataHandlerUnknownHandlerHTTPErrorProcessorurlopeninstall_opener build_opener pathname2url url2pathname getproxies urlretrieve urlcleanup URLopenerFancyURLopenerz%d.%dcontextcU(a[US9n[U5nO[c [5=qnO[nURXU5$)aOpen the URL url, which can be either a string or a Request object. *data* must be an object specifying additional data to be sent to the server, or None if no such data is needed. See Request for details. urllib.request module uses HTTP/1.1 and includes a "Connection:close" header in its HTTP requests. The optional *timeout* parameter specifies a timeout in seconds for blocking operations like the connection attempt (if not specified, the global default timeout setting will be used). This only works for HTTP, HTTPS and FTP connections. If *context* is specified, it must be a ssl.SSLContext instance describing the various SSL options. See HTTPSConnection for more details. This function always returns an object which can work as a context manager and has the properties url, headers, and status. See urllib.response.addinfourl for more detail on these properties. For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse object slightly modified. In addition to the three new methods above, the msg attribute contains the same information as the reason attribute --- the reason phrase returned by the server --- instead of the response headers as it is specified in the documentation for HTTPResponse. For FTP, file, and data URLs and requests explicitly handled by legacy URLopener and FancyURLopener classes, this function returns a urllib.response.addinfourl object. Note that None may be returned if no handler handles the request (though the default installed global OpenerDirector uses UnknownHandler to ensure this never happens). In addition, if proxy settings are detected (for example, when a *_proxy environment variable like http_proxy is set), ProxyHandler is default installed and makes sure the requests are handled through the proxy. r<) HTTPSHandlerr3_openeropen)urldatatimeoutr= https_handleropeners 4/opt/imh/python3.13/lib/python3.13/urllib/request.pyr1r1sCX$W5 m, '>)& ;;s' **cUqgN)r@)rFs rGr2r2sGrHcL[U5upE[R"[X55nUR 5nUS:Xa1U(d*[ R RU5U4sSSS5 $U(a [US5nO5[R"SS9nURn[RU5 U X4n Sn Sn Sn Sn S U;a[US 5n U(a U"XU 5 URU 5=n(aNU [!U5- n UR#U5 U S - n U(a U"XU 5 URU 5=n(aMNSSS5 SSS5 W S:aW U :a[%S X4-W 5eW $!,(df  N4=f!,(df  N==f) a+ Retrieve a URL into a temporary location on disk. Requires a URL argument. If a filename is passed, it is used as the temporary file location. The reporthook argument should be a callable that accepts a block number, a read size, and the total file size of the URL target. The data argument should be valid URL encoded data. If a filename is passed and the URL points to a local resource, the result is a copy from local file to new file. Returns a tuple containing the path to the newly created data file as well as the resulting HTTPMessage object. fileNwbF)delete rcontent-lengthContent-Length1retrieval incomplete: got only %i out of %i bytes)r contextlibclosingr1infoospathnormpathrAtempfileNamedTemporaryFilename_url_tempfilesappendintreadlenwriter)rBfilename reporthookrCurl_typerYfpheaderstfpresultbssizerablocknumblocks rGr7r7s}  _NH   GC. /2'') v h77##D)72 0 / x&C--U;CxxH  ! !( + &FBDDH7*7#3458.772;&%&E " % A xT2 772;&%&! 0F qyTD[" ?l "$ $ M1S! 0 /s+>F5A FBFF F F F#c[Hn[R"U5 M [SS2 [(aSqgg![a MCf=f)z0Clean up temporary files from urlretrieve calls.N)r^rXunlinkOSErrorr@) temp_files rGr8r8sJ#   IIi $ qw    s= A  A z:\d+$cURn[U5SnUS:XaURSS5n[R SUS5nUR 5$)z|Return request-host, as defined by RFC 2965. Variation from RFC: returned value is lowercased, for convenient comparison. rSHost)full_urlr get_header _cut_port_resublower)requestrBhosts rG request_hostr}sX   C C= D rz!!&"-   Ba (D ::<rHc\rSrSrS0SSS4Sjr\S5r\RS5r\RS5r\S5r \ RS 5r \ RS 5r S r S r S r Sr SrSrSrSrSSjrSrSrSrg)riNFcXl0Ul0UlSUlX lSUlUR 5HupxURXx5 M Uc [U5nX@l XPl U(aX`l ggrJ) rvrhunredirected_hdrs_datarC _tunnel_hostitems add_headerr}origin_req_host unverifiablemethod) selfrBrCrhrrrkeyvalues rG__init__Request.__init__!ss  !#   !--/JC OOC '*  "*40O.(  K rHcUR(a&SRURUR5$UR$)Nz{}#{})fragmentformat _full_urlrs rGrvRequest.full_url3s, ==>>$..$--@ @~~rHc[U5Ul[UR5uUlUlUR 5 grJ)r rrr_parserrBs rGrvr9s/ (1$..(A%  rHc.SUlSUlSUlg)Nrt)rrselectorrs rGrvr@s  rHcUR$rJ)rrs rGrC Request.dataFs zzrHcXR:wa/XlURS5(aURS5 ggg)NContent-length)r has_header remove_header)rrCs rGrCrJs< :: J/00""#341 rHcSUlgrJ)rCrs rGrCrTs  rHc[UR5uUlnURc[SUR-5e[ U5uUlUlUR (a[UR 5Ulgg)Nzunknown url type: %r) r rtype ValueErrorrvr r|rr )rrests rGrRequest._parseXsd$T^^4 4 99 3dmmCD D#-d#3  4= 99 *DI rHc>URbSOSn[USU5$)z3Return a string indicating the HTTP request method.POSTGETr)rCgetattr)rdefault_methods rG get_methodRequest.get_method`s!#'99#8etX~66rHcUR$rJ)rvrs rG get_full_urlRequest.get_full_urles }}rHcURS:Xa#UR(dURUlOX lURUlXlg)Nhttps)rrr|rvr)rr|rs rG set_proxyRequest.set_proxyhs7 99 (9(9 $ D I MMDM rHc4URUR:H$rJ)rrvrs rG has_proxyRequest.has_proxyps}} --rHc<X RUR5'grJ)rh capitalizerrvals rGrRequest.add_headerss), S^^%&rHc<X RUR5'grJ)rrrs rGadd_unredirected_headerRequest.add_unredirected_headerws36s~~/0rHcHXR;=(d XR;$rJ)rhrr header_names rGrRequest.has_header{s"||+6555 7rHclURRUURRX55$rJ)rhgetr)rrdefaults rGrwRequest.get_headers0||   " " & &{ <> >rHctURRUS5 URRUS5 grJ)rhpoprrs rGrRequest.remove_headers, d+ "";5rHch0UREUREn[UR55$rJ)rrhlistr)rhdrss rG header_itemsRequest.header_itemss,9$((9DLL9DJJL!!rH)rrrrCrrvrhr|rrrrrrrJ)__name__ __module__ __qualname____firstlineno__rpropertyrvsetterdeleterrCrrrrrrrrrwrr__static_attributes__rHrGrrs!%r!%E!$ __   [[55 \\+7 .-77> 6"rHrc^\rSrSrSrSrSrSrS\R4Sjr S Sjr S r S r g) ricpS[-nSU4/Ul/Ul0Ul0Ul0Ul0Ulg)NPython-urllib/%sz User-agent) __version__ addheadershandlers handle_open handle_errorprocess_responseprocess_request)rclient_versions rGrOpenerDirector.__init__sB+k9(.9:  "!rHc<[US5(d[S[U5-5eSn[U5GHnUS;aM UR S5nUSUnX4S-SnUR S5(aUUR S5U-S-nX7S-Sn[ U5nURRU05n XRU'OAUS:XaUnURn O,US :XaUnURn OUS :XaUnURn OMU RU/5n U (a[R"X5 OU R!U5 S nGM U(a3[R"UR"U5 UR%U5 gg![a Nf=f) N add_parentz%expected BaseHandler instance, got %rF)redirect_requestdo_open proxy_open_rSerrorrAresponser{T)hasattr TypeErrorrdirfind startswithr`rrrrrr setdefaultbisectinsortr_rr) rhandleraddedmethiprotocol conditionjkindlookuprs rG add_handlerOpenerDirector.add_handlersw --C M*+ +LDDD #ABQxHqST I##G,,NN3'!+a/aCDzt9D**..x<.4!!(+f$))j(..i'--((r2H h0(EG!J  MM$-- 1   t $ /"s F FFcgrJrrs rGcloseOpenerDirector.close rHchURUS5nUHn[Xc5nU"U6nUcMUs $ g)Nr)rr) rchainr meth_nameargsrrfuncrjs rG _call_chainOpenerDirector._call_chains<99T2&G7.D4[F!  rHNc[U[5(a [X5nO UnUbX$lX4lUR nUS-nUR RU/5Hn[Xv5nU"U5nM [R"SURURURUR55 URXB5n US-nURRU/5Hn[Xv5nU"XI5n M U $)N_requestzurllib.Request _response) isinstancestrrrCrDrrrrsysauditrvrhr_openr) rfullurlrCrDreqrr processorrrs rGrAOpenerDirector.opens gs # #'(CC 88Z' --11(B?I90Ds)C@ "CLL#((CKKIYZ::c([( ..228R@I90DC*HArHcURURSSU5nU(aU$URnURURXDS-U5nU(aU$URURSSU5$)Nr default_openrunknown unknown_open)rrr)rrrCrjrs rGrOpenerDirector._opens!!$"2"2I"0#7 M88!!$"2"2H")?*+.0 M 0 0) .5 5rHcUS;aURSnUSnSU-nSnUnOURnUS-nSnX1U4U-nUR"U6nU(aU$U(aUSS 4W-nUR"U6$g) Nhttprrr;z http_error_%srS_errorrrhttp_error_default)rr)rprotordictrhttp_err orig_argsrjs rGrOpenerDirector.errors % %$$V,DGE'%/IHI$$D(IHY'$.!!4( M )%9:YFD##T* * rH)rrrrrrrJ)rrrrrrrrsocket_GLOBAL_DEFAULT_TIMEOUTrArrrrrHrGrrs3 "-%^  "&v/M/M: 5+rHrc [5n[[[[[ [ [[[/ n[[RS5(aUR[5 [5nUHinUH`n[!U["5(a%[%XT5(aUR'U5 M;M=[!XT5(dMOUR'U5 Mb Mk UHnUR)U5 M UHnUR+U"55 M UH0n[!U["5(aU"5nUR+U5 M2 U$)aCreate an opener object from a list of handlers. The opener will use several default handlers, including support for HTTP, FTP and when applicable HTTPS. If any of the handlers passed as arguments are subclasses of the default handlers, the default handlers will not be used. HTTPSConnection)rr r/r*rrr,r+r0r.rrclientr_r?setr r issubclassaddremover)rrFdefault_classesskipklasscheckhs rGr3r3s F#^[.0C!;0B"$Ot{{-..|, 5D E%&&e++HHUO,E)) !u%!57#! a  A1 MrHc*\rSrSrSrSrSrSrSrg)ri?cXlgrJparent)rr5s rGrBaseHandler.add_parentBs rHcgrJrrs rGrBaseHandler.closeErrHcX[US5(dgURUR:$)N handler_orderT)rr:)rothers rG__lt__BaseHandler.__lt__Is+uo..!!E$7$777rHr4N) rrrrr:rrr<rrrHrGrr?sM 8rHrc&\rSrSrSrSrSr\rSrg)r0iRzProcess HTTP error responses.icURURUR5pTnSUs=::aS:d O URR SXX4U5nU$)N,r)codemsgrWr5r)rr{rrBrCrs rG http_response HTTPErrorProcessor.http_responseVsN"--x}}4t!c!{{((4d >ADfM  }}H~HHQKH%  \0B0BDv. ##CTH ;  3 ( (*-*;*; ;G' FA&$*:*::G  5 55 d $ s 2GAA6?A @G @c'#*;!++fa014    {{[[99rHzoThe HTTP server returned a redirect error that would lead to an infinite loop. The last 30x error message was: rN)rrrrrjrkrrphttp_error_301http_error_303http_error_307http_error_308rlrrrHrGrrgs<K!*N::xIWVNV^Vn~2GrHrcv[U5upURS5(dSnUnOmURS5(d[SU-5eSU;a$URS5nURSU5nOURSS5nUS:XaSnUSUn[ U5upgUb[ U5upOS=pXX4$)zReturn (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. raN//zproxy URL with no authority: %r@r;rP)r rrrrr) proxyrfr_scheme authorityhost_separatorenduserinfohostportuserpasswords rG _parse_proxyrs"%(F   s # # ""4((>FG G (?%]]3/N--^4C--Q'C "9CQsO #I.H%h/h  ++rHc(\rSrSrSrSSjrSrSrg)r idNcUc [5n[US5(dS5eXlUR5H4up#UR 5n[ USU-X2UR 4Sj5 M6 g)Nkeysproxies must be a mappingz%s_opencU"XU5$rJr)rryrrs rG'ProxyHandler.__init__..s Qt,rH)r6rproxiesrrzsetattrr)rrrrBs rGrProxyHandler.__init__sh ? lGw''D)DD'  ID::rHr c6\rSrSrSrSrSrS SjrSrSr g) r!i%c0UlgrJpasswdrs rGrHTTPPasswordMgr.__init__'s  rHc^^[U[5(aU/nUTR;a0TRU'SH,m[UU4SjU55nX44TRUU'M. g)NTFc3H># UHnTRUT5v M g7frJ) reduce_uri).0u default_portrs rG /HTTPPasswordMgr.add_password..1s" ?:=Q<00#s")r r rtuple)rrealmr^rr reduced_urirs` @rG add_passwordHTTPPasswordMgr.add_password*sg c3  %C  #!#DKK 'L ?:= ??K/3nDKK { +(rHcURRU05nSHTnURX$5nUR5H,upgUH!nUR X5(dMUs s s $ M. MV g)NrNN)rrrr is_suburi) rrauthuridomainsrreduced_authuriurisauthinfor^s rGfind_user_password"HTTPPasswordMgr.find_user_password5sc++//%,'L"oogDO")--/C~~c;;' #2( rHc[U5nUS(aUSnUSnUS=(d SnOSnUnSn[U5upxU(a#Uc UbSSS.RU5n U bS Xy4-nXV4$) z@Accept authority or URI and extract only the authority and path.rSrr;raNPirz%s:%d)rrr) rr^rpartsrfr{rYr|portdports rGrHTTPPasswordMgr.reduce_uri?s  81XFaI8?sDFID *  DLV-?!s6{  #tm3 rHcvX:XagUSUS:wagUSnUSSS:waUS- nUSRU5$)zSCheck if test is below base in a URI tree Both args must be URIs in reduced form. TrFrSrPNra)r)rbasetestprefixs rGrHTTPPasswordMgr.is_suburiVsT < 7d1g a "#;#  cMFAw!!&))rHrN)T) rrrrrrrrrrrrHrGr!r!%s =. *rHr!c\rSrSrSrSrg)r"iecl[RXU5up4UbX44$[RUSU5$rJ)r!r)rrrrrs rGr2HTTPPasswordMgrWithDefaultRealm.find_user_passwordgs=(;;D !11$gFFrHrN)rrrrrrrrHrGr"r"esGrHr"cH^\rSrSrU4SjrSU4SjjrSSjrSrSrU=r $)r#ioc0>0Ul[TU] 5 grJ) authenticatedsuperr)r __class__s rGr%HTTPPasswordMgrWithPriorAuth.__init__qs rHcp>URX%5 Ub[TU] SX#U5 [TU] XX45 grJ)update_authenticatedrr)rrr^rris_authenticatedrs rGr)HTTPPasswordMgrWithPriorAuth.add_passwordus7 !!#8   G s& 9 U6rHc[U[5(aU/nSH+nUH"nURXC5nX RU'M$ M- gNr)r r rr)rr^rrrrs rGr1HTTPPasswordMgrWithPriorAuth.update_authenticated|sF c3  %C'L"ooa> 2B"";/(rHcSHPnURX5nURH,nURXC5(dMURUs s $ MR gr)rrr)rrrrr^s rGr-HTTPPasswordMgrWithPriorAuth.is_authenticatedsJ'L"oogDO))>>#77--c22*(rH)r)F) rrrrrrrrr __classcell__)rs@rGr#r#os7C33rHr#c~\rSrSr\R "S\R 5rS SjrSr Sr Sr Sr S r \ r\ rS rg) r$iz1(?:^|,)[ ]*([^ ,]+)[ ]+realm=(["']?)([^"']*)\2Nc`Uc [5nXlURRUlgrJ)r!rr)r password_mgrs rGr!AbstractBasicAuthHandler.__init__s'  *,L"  KK44rHc#*# Sn[RRU5H?nUR5upEnUS;a[R "S[ S5 XF4v SnMA U(d$U(aUR5SnOSnUS4v gg7f)NF)"'zBasic Auth Realm was unquotedTrrt)r$rxfinditergroupswarningswarn UserWarningsplit)rheaderfound_challengemorfr rs rG _parse_realm%AbstractBasicAuthHandler._parse_realms*--66v>B#%99; F5J& =)1./ !"O?*4. sBBcURU5nU(dgSnUHNnURU5H6upxUR5S:waUnMUcM"URX#U5s s $ MP Ub[ SW<35eg)Nbasicz@AbstractBasicAuthHandler does not support the following scheme: )get_allrrzretry_http_basic_authr) rauthreqr|rrh unsupportedrrfrs rGhttp_error_auth_reqed.AbstractBasicAuthHandler.http_error_auth_reqeds//'*  F!%!2!26!: <<>W,"(K$ 55dGG";  " &)* * #rHcURRX15upEUbU<SU<3nS[R"UR 55R S5-nUR URS5U:XagURURU5 URRX"RS9$g)Nrrrre) rrrrrrrw auth_headerrr5rArD)rr|rrrpwrawauths rGr.AbstractBasicAuthHandler.retry_http_basic_auths;;11%> >!2&Cf..szz|<CCGLLD~~d..5=  ' '(8(8$ ?;;##C#= =rHc[URS5(a*URRUR5(dU$UR S5(dURR SUR5up#SR X#5R5n[R"U5R5nURSSR UR555 U$)Nr Authorizationz{0}:{1}zBasic {}) rrrrvrrrrrstandard_b64encoderrstrip)rrrr credentialsauth_strs rG http_request%AbstractBasicAuthHandler.http_requests %788{{++CLL99J~~o..;;99$ MLD#**48??AK00=DDFH  ' '(2(9(9(..:J(K M rHc [URS5(ahSURs=::aS:a+O O(URRURS5 U$URRURS5 U$)Nrr@rATF)rrrBrrv)rrrs rGrD&AbstractBasicAuthHandler.http_responsesc 4;; 2 3 3hmm)c) 00tD 00uErH)rrrJ)rrrrrecompileIrrrrrrrD https_requestrGrrrHrGr$r$sJ 1DD B5 !(*4  !M"NrHr$c\rSrSrSrSrSrg)r%ircDURnURSXaU5nU$)Nwww-authenticate)rvr)rrrgrBrCrhrBrs rGhttp_error_401#HTTPBasicAuthHandler.http_error_401s(ll--.@*-G=rHrN)rrrrrr rrrHrGr%r%s !KrHr%c\rSrSrSrSrSrg)r&ircDURnURSXaU5nU$Nproxy-authenticate)r|r)rrrgrBrCrhr{rs rGhttp_error_407$ProxyBasicAuthHandler.http_error_407 s+ HH --.B*3'CrHrN)rrrrrrrrrHrGr&r&s 'KrHr&cH\rSrSrS SjrSrSrSrSrSr S r S r S r g) r'iNcUc [5nXlURRUlSUlSUlSUlgNr)r!rrretried nonce_count last_nonce)rrs rGr"AbstractDigestAuthHandler.__init__&s< >$&F  KK44 rHcSUlgr)rrs rGreset_retry_count+AbstractDigestAuthHandler.reset_retry_count/s  rHchURUS5nURS:a[URSSUS5eU=RS- slU(a[UR 5SnUR 5S:XaUR X55$UR 5S:wa[SU-5egg) Nizdigest auth failedrSrdigestrzEAbstractDigestAuthHandler does not support the following scheme: '%s')rrrrvrrzretry_http_digest_authr)rrr|rrhrrfs rGr/AbstractDigestAuthHandler.http_error_auth_reqed2s++k40 <r?rAHKDrrentdigA1A2respdigncvaluecnoncenoncebitrs rGr'+AbstractDigestAuthHandler.get_authorization]s MEME((5/Ce4IXXh-F((3 9;;11%F < 88 ++CHHd;FF +( & ;25!B% 89G syy~ %'  A% #$ "'t///G__U+F+0'661R5QH2)G7#=> > #'ucll")+  Of, ,D  Of, ,D "Y..  H HD g  s?G;; HHc\^US:XaSmOUS:XaSmO[SU-5eU4SjnTU4$)Nr@ch[R"URS55R5$Nr)r4md5rr6xs rGr?AbstractDigestAuthHandler.get_algorithm_impls..s'++ahhw&78BBDrHSHAch[R"URS55R5$rR)r4r5rr6rTs rGrrVs',,qxx'89CCErHz.Unsupported digest authentication algorithm %rc">T"U<SU<35$)Nrr)r8drFs rGrrVs!q!,-rH)r)rr?rGrFs @rGrD-AbstractDigestAuthHandler.get_algorithm_implssG  DA % EA,.789 9 -"u rHcgrJr)rrCr*s rGrE+AbstractDigestAuthHandler.get_entity_digestsrH)rrrrrrJ) rrrrrrrr!r;r'rDrErrrHrGr'r's,I(  <| rHr'c&\rSrSrSrSrSrSrSrg)r(izAn authentication protocol defined by RFC 2069 Digest authentication improves on basic authentication because it does not transmit passwords in the clear. rc|[UR5SnURSXaU5nUR5 U$)NrSr )rrvrrrrrgrBrCrhr|retrys rGr $HTTPDigestAuthHandler.http_error_401s> %a(**+=+/g?   rHrN) rrrrrFrr:r rrrHrGr(r(s "KMrHr(c"\rSrSrSrSrSrSrg)r)iProxy-Authorizationr_cdURnURSXaU5nUR5 U$r)r|rrras rGr%ProxyDigestAuthHandler.http_error_407s4xx**+?+/g?   rHrN)rrrrrr:rrrrHrGr)r)s'KMrHr)c6\rSrSrS SjrSrSrSrSrSr g) AbstractHTTPHandleriNcjUbXlg[RRRUlgrJ)rr'HTTPConnection debuglevel _debuglevel)rrls rGrAbstractHTTPHandler.__init__s$)3)?:T[[E_E_EjEjrHcXlgrJrm)rlevels rGset_http_debuglevel'AbstractHTTPHandler.set_http_debuglevels rHc[RRRURUR 55$rJ)rr'rk_get_content_lengthrCrrr{s rGru'AbstractHTTPHandler._get_content_lengths2{{))== LL    " "rHcZURnU(d [S5eURbURn[U[5(a Sn[ U5eUR S5(dURSS5 UR S5(dXUR S5(dBURU5nUbURS[ U55 OURSS5 UnUR5(a$[UR5upx[U5upiUR S5(dURSU5 URRH>upU R5n UR U 5(aM-URX5 M@ U$) N no host givenz\POST data should be bytes, an iterable of bytes, or a file object. It cannot be of type str.z Content-type!application/x-www-form-urlencodedrTransfer-encodingchunkedru)r|rrCr r rrrrurr rr r5rr) rr{r|rCrCcontent_lengthsel_hostrfselsel_pathr]rs rG do_request_AbstractHTTPHandler.do_request_sw||?+ + << #<L B  $ #..*CLL#((G),8K)LN A 66 FFLLNAF  " e-G  $sm# $  GGI s= G G GAG#G6 G3# G..G33G66H rprJ) rrrrrrrrurrrrrHrGririsk!" $L@rHric2\rSrSrSr\R rSrg)r*iAcVUR[RRU5$rJ)rrr'rkrrs rG http_openHTTPHandler.http_openCs||DKK66<Parse list of key=value strings where keys are not duplicated.=rSrrrP)r)lparsedeltrXrYs rGr$r$usQ Fyya  Q43;1R5C<!BAq  MrHcF/nSnS=p4UHXnU(aX%- nSnMU(aUS:XaSnM#US:XaSnX%- nM1US:XaURU5 SnMLUS:XaSnX%- nMZ U(aURU5 UVs/sHo"R5PM sn$s snf)aXParse 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. rtF\TrrB)r_r)r8respartescaper curs rGr&r&s C DF  KDF  d{ KD  #: JJt D  #:E -2  4%( )STJJLS )) )sBc*\rSrSrSrSrSrSrSrg)r+icURnUSSS:XaTUSSS:waKUR(a:URS:wa*URUR5;a [S5egUR U5$)Nr;rwrra localhost-file:// scheme is supported only on localhost)rr| get_namesropen_local_file)rrrBs rG file_openFileHandler.file_opensmll r7d?s1Qx3CHHK'88t~~//NOO0'', ,rHNc[Rci[[R"S5S[R"[R "55S-5[l[R$[R$![R a2 [R"S54[l[R$f=f)Nrr;)r+namesrr#gethostbyname_ex gethostnamegaierror gethostbynamers rGrFileHandler.get_namess    $ I$)++K8;++F,>,>,@A!DE%F !    {   ?? I%+%9%9+%F$H !    IsAB 4CCcrSSKnSSKnURnURn[ U5n[ R "U5nURnURRURSS9n URU5Sn UR"SU =(d SX4-5n U(a [U5upLU(a$W (dH[U5UR5;a+U(a SU-U-n OSU-n [![#US5X5$['S5e![$an['U5eSnAff=f) NrTusegmtz6Content-type: %s Content-length: %d Last-modified: %s text/plainfile://rbzfile not on local host) email.utils mimetypesr|rr5rXstatst_sizeutils formatdatest_mtime guess_typemessage_from_stringr_safe_gethostbynamerrrArqr)rremailrr|rd localfilestatsrlmodifiedmtyperhrorigurlexps rGrFileHandler.open_local_filesxx<< *  GGI&E==D{{--ennT-JH((215E//K&,789G'- 1$74>>;KK'$.9G'(2G!$y$"7JJ/00 3-  sC#D D6& D11D6r) rrrrrrrrrrrHrGr+r+s- E!1rHr+cd[R"U5$![Ra gf=frJ)r#rr)r|s rGrrs.##D)) ??s //c \rSrSrSrSrSrg)r,icSSKnSSKnURnU(d [S5e[ U5upEUc UR nO [ U5n[U5updU(a[U5upgOSn[U5nU=(d SnU=(d Sn[R"U5n[UR5upU RS5n [![#[U 55n U SSU SpU (aU S(dU SSn UR%XgXEXR&5n U =(a S=(d SnU H?n[)U5unnUR+5S :XdM'US ;dM/UR-5nMA U R/X5unnSnUR1UR25SnU(aUS U-- nUbUS:aUS U-- n[4R6"U5n[9UUUR25$![an[U5eSnAff=f!UR:an[U5UeSnAff=f) Nrftp error: no host givenrtrarPrSrDraArrrZrzContent-type: %s zContent-length: %d )ftplibrr|rrFTP_PORTr`rrr r#rrqrrrrmap connect_ftprDrrzupperretrfilerrvrrr all_errors)rrrrr|rrrrCrYattrsdirsrLfwrattrrrgretrlenrhrrs rGftp_openFTPHandler.ftp_opensxx56 6%  <??Dt9D %  '-LD&Ft}zr2 ''-D!. zz#C&'#2YRd Q8D )!!$D++NBH AH &H .BH  H HH I0 H<<Ic [XX4XVSS9$)NF) persistent) ftpwrapper)rrrr|rrrDs rGrFTPHandler.connect_ftps$D%*, ,rHrN)rrrrrrrrrHrGr,r,s 2)h,rHr,c8\rSrSrSrSrSrSrSrSr Sr g ) r-icJ0Ul0UlSUlSUlSUlg)Nr<r0)cacherDsoonestdelay max_connsrs rGrCacheFTPHandler.__init__s%    rHcXlgrJ)r)rts rG setTimeoutCacheFTPHandler.setTimeout&s rHcXlgrJ)r)rrVs rG setMaxConnsCacheFTPHandler.setMaxConns)srHczXUSRU5U4nXpR;a0[R"5UR-URU'OI[ XX4XV5URU'[R"5UR-URU'UR 5 URU$)Nra)joinrr1rrDr check_cache)rrrr|rrrDrs rGrCacheFTPHandler.connect_ftp,s$7 **  $ djj 8DLL (t)-8DJJsO $ djj 8DLL  zz#rHc[R"5nURU::aj[URR 55HCup#X1:dM UR UR 5 UR U URU ME [[URR555Ul[UR 5UR:Xa[URR 55H0up#X0R:XdMUR U URU O [[URR555UlggrJ) r1rrrDrrrminvaluesrbr)rr rXrYs rGrCacheFTPHandler.check_cache7s IIK <<1 T\\//125JJqM'') 1  Q 3 4 3 3 567  tzz?dnn ,T\\//12 $ 1  Q 3 tDLL$7$7$9:;DL -rHcURR5HnUR5 M URR5 URR5 grJ)rrrclearrD)rconns rG clear_cacheCacheFTPHandler.clear_cacheKsBJJ%%'D JJL(  rH)rrrrrDN) rrrrrr r rrrrrrHrGr-r-s  <(rHr-c\rSrSrSrSrg)r.iQc|URnURSS5up4URSS5upT[U5nURS5(a[R "U5nUSSnU(dSn[ R"SU[U54-5n[[R"U5Xb5$)NrrSrBz;base64itext/plain;charset=US-ASCIIz$Content-type: %s Content-length: %d ) rvrrendswithr decodebytesrrrbrioBytesIO)rrrBrfrC mediatyperhs rG data_openDataHandler.data_openRsllyyQ' **S+  %   i ( (%%d+D!#2I5I++,T D "-#$"**T*G99rHrN)rrrrr$rrrHrGr.r.Qs:rHr.rMnt)r5r4cUSSS:XaUSSnOUSSS:XaUSSn[R"5n[R"5n[XUS9$) zwOS-specific conversion from a relative URL of the 'file' scheme to a file system path; not recommended for general use.Nrz///r; z //localhost/ rberrors)r getfilesystemencodinggetfilesystemencodeerrorsr pathnamerbr+s rGr5r5xsa BQ<5  |H cr]n ,}H,,...0x6BBrHcUSSS:XaSU-n[R"5n[R"5n[XUS9$)zwOS-specific conversion from a file system path to a relative URL of the 'file' scheme; not recommended for general use.Nr;rwr*)r r,r-r r.s rGr4r4sF BQ<4 hH,,...0X@@rHc\rSrSrSrSrS\-rSSjrSr Sr Sr S r SS jr SS jrSS jrSS jrSrSSjrSSjrSr\(aSrSSjrSrSrSrSSjrSrg)r9iaClass to open URLs. This is a class rather than just a subroutine because we may need more than one set of global protocol-specific options. Note -- this is a base class for those who don't want the automatic handling of errors type 302 (relocated) and 401 (authorization needed).Nrc SSURR0-n[R"U[SS9 Uc [ 5n[ US5(dS5eXlURS5Ul URS5Ul S UR4S /Ul /Ul [RUlSUl[$Ulg) NzW%(class)s style of invoking requests is deprecated. Use newer urlopen functions/methodsclassr) stacklevelrrkey_file cert_filez User-Agent)Acceptz*/*)rrrrDeprecationWarningr6rrrr5r6versionr_URLopener__tempfilesrXrp_URLopener__unlink tempcacheftpcache)rrx509rCs rGrURLopener.__init__s47>@W@W6XY c-!< ? lGw''D)DD' , +.($,,79JK  ! rHc$UR5 grJ)rrs rG__del__URLopener.__del__s  rHc$UR5 grJ)cleanuprs rGrURLopener.closes  rHcUR(a4URHnURU5 M URSS2 UR(aURR 5 gg![a Mbf=frJ)r:r;rqr<r)rrLs rGrDURLopener.cleanupsn   ((MM$')   # >> NN " sA33 BBc:URRU5 g)z\Add a header to be used by the HTTP interface only e.g. u.addheader('Accept', 'sound/basic')N)rr_)rrs rG addheaderURLopener.addheaders t$rHc[[U55n[USS9nUR(a8XR;a)URUup4[ US5n[ XTU5$[ U5upgU(dSnX`R;a-URUn[ U5upi[U 5upX4nOSnSU-n X`l U RSS5n [X 5(aU S :Xa*U(aURXU5$URX5$Uc[X 5"U5$[X 5"Xr5$![[ 4a e["an [#S U 5U eSn A ff=f) z6Use URLopener().open(file) instead of open(file, 'r').z%/:=&?~#+!$,;'@()*[]|rcrrLNopen_-rrz socket error)r rr r<rArr rr rrTropen_unknown_proxy open_unknownrrrrq)rrrCrdrhrgurltyperBry proxyhostr|rr]rCs rGrAURLopener.opens[7+,&=> >>g7 $w 7 Hh%Bb73 3!'* G ll "LL)E!+E!2 G' 2ND/CE  ||C%t""d.?&?..utDD((77 8|t*3//t*3558$   8.#.C 7 8sD?.D??E+ E&&E+c6[U5up4[SSU5e)/Overridable interface to open unknown URL type. url errorzunknown url typer rq)rrrCrrBs rGrPURLopener.open_unknownsw' k#5t<>c^^3>>#& &_   TTV^ ))$/wwy #Jt$4Q$78$>>YYs !" ggiG8T* *3  *4:2 6  +DJB 7  *4:2 6 ))$/2!)!1!1&!9  ''1iiD) !*>>-*0NN3'#w.w'789DxT2!wwr{*e*CJ&DIIe$MH!"8R6 "wwr{*e* HHJ 19&C, &( ( [  F HHJs9"A J>CJ6B0J!J6 JJ!J33J66KcHSnSn[U[5(a/[U5upgU(a[U5upF[ U5nUnOUupg[U5upV[ U5upU nSnU R 5S:waSnOF[U 5upU(a [U5upHU(a U <SU<U <3n[U5(aUnU(d [SS5eU(a?[ U5n[R"UR55RS5n OSn U(a?[ U5n[R"UR55RS5n OSn U"U5n 0nU (aSU -US'U (aSU -US 'U(aXS 'S US 'URH unnUX'M UbS US'U RSXsU5 OU RSX~S9 U R5nSUR(s=::aS:a(O O%[+UUR,SU-UR(5$UR/UUR0UR(UR2UR,U5$![ R"R$a ['S5ef=f)aQMake an HTTP connection using connection_class. This is an internal method that should be called from open_http() or open_https(). Arguments: - connection_factory should take a host name and return an HTTPConnection instance. - url is the url to retrieval or a host, relative-path pair. - data is payload for a POST request or None. Nrz://z http errorryrzBasic %srerrurrrzz Content-Typerrrz$http protocol error: bad status liner@rAhttp:)r r r rr r rzrrqrrrrrr{rrr' BadStatusLinerstatusrrC http_errorrgr)rconnection_factoryrBrC user_passwd proxy_passwdr|rrealhostrQr proxy_authr http_connrhrrrs rG_open_generic_httpURLopener._open_generic_httpCsv  c3  '_ND$.t$4! t}H ND!+D!1 L&x0MGCK}}&(!+D!1,6x,@)K.5xFH))#D7<AA "<0L)),*=*=*?@GGPJJ !+.K##K$6$6$89@@IDD&t,  -7*-DG) * (2T(9GO $ &FO !( !__MFE#GO-  &IGN #   fhg >   eX  ? C ,,.H (// 'C 'h gm&oo/ /??X[[(,,F F{{(( CAB B Cs *I77*J!cVUR[RRX5$)zUse HTTP protocol.)rprr'rkrrBrCs rG open_httpURLopener.open_https&&t{{'A'A3MMrHcSU-n[X5(a,[X5nUc U"XX4U5n O U"XX4XV5n U (aU $URXX4U5$)zHandle http errors. Derived class can override this, or provide specific handlers named http_error_DDD where DDD is the 3-digit error code.z http_error_%d)rrr) rrBrgerrcodeerrmsgrhrCr]rrjs rGriURLopener.http_errors` ( 4  T(F|'B'Hf}&&sIIrHc<UR5 [XXES5e)z>Default error handler: close the connection and raise OSError.N)rrrrBrgrwrxrhs rGrURLopener.http_error_defaults  ft<Un USSS:XaS U-n OUSS S :Xa[/S U-5e[![#US 5X5$[S5e![ a%n[URUR5eSnAff=f)zUse local file.rNTrz6Content-Type: %s Content-Length: %d Last-modified: %s rrSrarrr;z./zAlocal file url may start with / or file:. Unknown url of type: %sz#local file error: not on local host)rrr r5rXrrqrstrerrorrdrrrrrrrrArr#rrthishostr)rrBrrr|rL localnamererlrrrhurlfilers rGrURLopener.open_local_filesw_  &  3GGI&E}};;))%..)F$$S)!,++ G  "lD 3 45GBQx3#d*d9d3WF F% ##D)y{nxz.IJGBQx3#d*bqT! !dgj!jkkd9d3WF F<==- 31::qzz2 2 3sE F E>>Fc[U[5(d [S5eSSKn[ U5up4U(d [S5e[ U5up5[ U5upcU(a[U5upgOSn[U5n[U=(d S5n[U=(d S5n[R"U5nU(dSSK nURnO [U5n[U5upI[U5nURS5n U SSU SpU (aU S(dU SSn U (aU S(dSU S'XcUSR!U 54n [#UR$5[&:aO[)UR$5H6n X:wdM UR$U nUR$U UR+5 M8 XR$;a[-XgX5U 5UR$U 'U (dS nOS nU H?n[/U5unnUR15S :XdM'US ;dM/UR35nMA UR$U R5X5unnUR7S U-5SnSnU(aUSU-- nUbUS:aUSU-- n[8R:"U5n[=UUS U-5$![?5an[SU35UeSnAff=f)zUse FTP protocol.zCftp error: proxy support for ftp protocol currently not implementedrNrrtrarPrSrrrrzftp:zContent-Type: %s zContent-Length: %d ftp error: ) r r rrr rrrr r#rrrr`rrrrbr= MAXFTPCACHErrrrrzrrrrrr ftperrors)rrBrr|rYrrrrrrrLrrXrYrrrrgrrrhrs rGopen_ftpURLopener.open_ftps#s##`a a_ 8$>??% %   T 2vft}tzr"2&##D) ??Dt9D & t}zz##2YRd QQR Q3a$. t}}  +$--(8 a(A a(GGI )  9--'tT> c"$)$/ e::<6):: ;;=D  !MM#.77CMR((#6q9EG/%77"w!|1G;;//8Gb'6C<8 8{ 9[./S 8 9s&AJ:J:&BJ::KKKc v[U[5(d [S5eURSS5up2U(dSnUR S5nUS:aS X4S ;a X4S-S nUS UnOS n/nURS [R"S [R"[R"555-5 URSU-5 US:Xa5[R"URS55RS5nO [U5nURS[!U5-5 URS 5 URU5 SR#U5n[$R&"U5n[(R*"U5n[-XU5$![a [ SS5ef=f)zUse "data" URL.zEdata error: proxy support for data protocol currently not implementedrBrSz data errorz bad data URLr;rrNrtzDate: %sz%a, %d %b %Y %H:%M:%S GMTzContent-type: %srrzlatin-1zContent-Length: %d )r r rrrrqrfindr_r1strftimegmtimerr rrr rbrrrr!StringIOr) rrBrCrsemirbrCrhfs rG open_dataURLopener.open_data-s}#s##bc c 899S!,LT0Dzz# 19DK/FG}H;DH :dmm,G,0KK ,DFF G %,- x %%dkk'&:;BB9MD4=D '#d)34 2 4iin++C0 KK !c**5 8,7 7 8s F!!F8) __tempfiles__unlinkrr6r=r5rr<rrJr)rrrrrFr:rr9rrArrDrIrArPrOrcrprtrir _have_sslrrrrrrrrrHrGr9r9sK ;.G!4 #% "8H= I :|ZFxNJ =  F N->@89t'+rHr9c\rSrSrSrSrSrSSjrSrSSjr SS jr SS jr SS jr SS jr SS jrSSjrSSjrSSjrSSjrSSjrSrSrg)r:iWz?Derived class with handlers for errors we can handle (perhaps).cb[R"U/UQ70UD6 0UlSUlSUlg)NrrM)r9r auth_cachetriesmaxtries)rrkwargss rGrFancyURLopener.__init__Zs/41$1&1  rHc"[X%SU-U5$)z3Default error handling -- don't raise an exception.rf)rr{s rGr!FancyURLopener.http_error_default`s"w}g>>rHNcLU=RS- slUR(aVURUR:a<[US5(a URnO URnU"XSSU5SUl$UR XX4XV5nUSUl$!SUlf=f)z%Error 302 -- relocated (temporarily).rShttp_error_500r2z)Internal Server Error: Redirect Recursionr)rrrrrredirect_internal) rrBrgrwrxrhrCrrjs rGrpFancyURLopener.http_error_302ds a  }}t}}!<4!122..D22DCSG#%DJ ++CW,3;FDJDJsAB>B B#c SU;aUSnO SU;aUSnOgUR5 [URS-U-U5n[U5nURS;a[ XsUSU--XR5eUR U5$)Nr]r^rr_z( Redirection to url '%s' is not allowed.)rrrrrfrrA) rrBrgrwrxrhrCrUrms rGr FancyURLopener.redirect_internalvs  Z(F g U^F   S3.7F# ??"> >F"FOP#) ) yy  rHc(URXX4XV5$)z*Error 301 -- also relocated (permanently).rprrBrgrwrxrhrCs rGrrFancyURLopener.http_error_301""3GWKKrHc(URXX4XV5$)z;Error 303 -- also relocated (essentially identical to 302).rrs rGrsFancyURLopener.http_error_303rrHcTUcURXX4XV5$URXX4U5$)z1Error 307 -- relocated, but turn POST into error.)rprrs rGrtFancyURLopener.http_error_3071 <&&sO O**3GWM MrHcTUcURXX4XV5$URXX4U5$)z1Error 308 -- relocated, but turn POST into error.)rrrrs rGruFancyURLopener.http_error_308rrHcSU;a[RXUX4U5 USn[R"SU5n U (d[RXUX4U5 U R 5upU R 5S:wa[RXUX4U5 U(d[RXX#UU5 SUR -S-n Uc[X 5"X5$[X 5"XU5$)zWError 401 -- authentication required. This function supports Basic authentication only.r ![ ]*([^ ]+)[ ]+realm="([^"]*)"rretry_ _basic_authr9rrmatchrrzrr rrBrgrwrxrhrCrbstuffrrfrr]s rGr FancyURLopener.http_error_401s W ,  ( (B)0' C*+?G  ( (B)0' C   <<>W $  ( (B)0' C  ( (B $))#m3 <4%c1 14%c$7 7rHcSU;a[RXUX4U5 USn[R"SU5n U (d[RXUX4U5 U R 5upU R 5S:wa[RXUX4U5 U(d[RXX#UU5 SUR -S-n Uc[X 5"X5$[X 5"XU5$)z]Error 407 -- proxy authentication required. This function supports Basic authentication only.rrr retry_proxy_rrrs rGrFancyURLopener.http_error_407s w .  ( (B)0' C,-?G  ( (B)0' C   <<>W $  ( (B)0' C  ( (B  )M9 <4%c1 14%c$7 7rHc[U5upESU-U-nURSn[U5up[U 5upU RS5S-n XSn UR XU 5upU (dU (dg[ U SS9<S[ U SS9<SU <3n SU -U -URS'UcUR U5$UR Xc5$)Nhttp://rrxrSrtrLrr rr rget_user_passwdr rArrBrrCr|rrUryrQrR proxyselectorrrrs rGretry_proxy_http_basic_auth*FancyURLopener.retry_proxy_http_basic_auths#CT!H, V$'.#-i#8 NN3 ! #bM ++Ia@ "'2"6"'R"8)E (94}D V <99V$ $99V* *rHc[U5upESU-U-nURSn[U5up[U 5upU RS5S-n XSn UR XU 5upU (dU (dg[ U SS9<S[ U SS9<SU <3n SU -U -URS'UcUR U5$UR Xc5$)Nhttps://rrxrSrtrLrrrs rGretry_proxy_https_basic_auth+FancyURLopener.retry_proxy_https_basic_auths#Cd"X- W%'.#-i#8 NN3 ! #bM ++Ia@ "'2"6"'R"8)E *Y 6 F W <99V$ $99V* *rHc&[U5upEURS5S-nXFSnURXBU5upxU(dU(dg[USS9<S[USS9<SU<3nSU-U-n UcUR U 5$UR X5$)NrxrSrtrLrrr rrr rA rrBrrCr|rrrrrUs rGr$FancyURLopener.retry_http_basic_auths#C IIcNQ Bx++D; "4b1"63T;T!H, <99V$ $99V* *rHc&[U5upEURS5S-nXFSnURXBU5upxU(dU(dg[USS9<S[USS9<SU<3nSU-U-n UcUR U 5$UR X5$)NrxrSrtrLrrrrs rGretry_https_basic_auth%FancyURLopener.retry_https_basic_auth s#C IIcNQ Bx++D; "4b1"63T;d"X- <99V$ $99V* *rHcUS-UR5-nX@R;a$U(aURU OURU$URX5upVU(dU(aXV4URU'XV4$)Nrx)rzrprompt_user_passwd)rr|rrrrrs rGrFancyURLopener.get_user_passwd slckDJJL( // !OOC(s++..t;  64.4??3/|rHc SSKn[SU<SU<S35nURSU<SU<SU<S35nXE4$![a [5 gf=f) z#Override this in a GUI environment!rNzEnter username for z at z: zEnter password for z in r)getpassinputKeyboardInterruptprint)rr|rrrrs rGr!FancyURLopener.prompt_user_passwd% sR E4HID__ud&$%F<    G s4;AA)rrrrJ)NF)r)rrrrrFrrrprrrrsrtrur rrrrrrrrrrHrGr:r:WsmI ?$!8LLNNFJ82FJ82+$+$ + +  rHr:cH[c[R"S5q[$)z8Return the IP address of the magic hostname 'localhost'.r) _localhostr#rrrHrGrr5 s ))+6 rHc[c<[[R"[R"55S5q[$[$![R a* [[R"S5S5q[$f=f)z,Return the IP addresses of the current host.r;r) _thishostrr#rrrrrHrGrr= sw Gf55f6H6H6JKANOI 9 Gf55kB1EFI  Gs5A 6BBc<[cSSKnURq[$)z1Return the set of errors raised by the FTP class.Nr) _ftperrorsrr)rs rGrrH s&& rHcH[c[R"S5q[$)z%Return an empty email Message object.rt) _noheadersrrrrHrG noheadersrQ s ..r2 rHcJ\rSrSrSrS SjrSrSrSrSr S r S r S r g) ri[ z;Class used by open_ftp() for cache of open FTP connections.NcXlX lX0lX@lXPlX`lSUlXplUR5 g! UR5 e=fr) rrr|rrrDrefcount keepaliveinitr)rrrr|rrrDrs rGrftpwrapper.__init__^ sM       #  IIK  JJL s AAcSSKnSUlUR5UlURR UR UR UR5 URRURUR5 SRUR5nURRU5 g)Nrra)rbusyFTPr`connectr|rrDloginrrrrcwd)rr_targets rGrftpwrapper.initn sw ::< DIIt||< tyy$++.((499%  WrHchSSKnUR5 US;aSnSnOSU-nSnURRU5 SnU(a*U(d#SU-nURR U5upgU(dURRS5 U(aYURR5n URRU5 URRU 5 S U-nOS nURR U5upgSUl [URS 5UR5n U=R S- slUR#5 U W4$!URa/ UR 5 URRU5 GNgf=f!URa,n[U5SSS:wa[S U35UeSnAGNoSnAff=f!URan[S U-5UeSnAff=f!URRU 5 f=f)Nr)rZrzTYPE ArSzTYPE zRETR r550rz ftp error: %rzLIST LISTr)r endtransferr`voidcmdrr ntransfercmd error_permr rpwdrrrmakefile file_closerr) rrLrrcmdisdirrrrrftpobjs rGrftpwrapper.retrfilew s  : XsqudNcAE " HH  S !  Gn $ 5 5c :  HH  X &hhlln&M T*HHLL%n HH11#6MD dmmD14??C     G   " IIK HH  S ! "$$ Gv;r?e+"[#9:F, G",,M&'?@fLMHHLL%sME,"F.;G-,;F+*F+.G*>!G%%G*-H=H  HHH1cUR(dgSUlURR5 g![5a gf=fr)rr`voidresprrs rGrftpwrapper.endtransfer s<yy    HH   {   s6AAcTSUlURS::aUR5 gg)NFr)rr real_closers rGrftpwrapper.close s$ ==A  OO  rHcUR5 U=RS-slURS::a#UR(dUR5 ggg)NrSr)rrrrrs rGrftpwrapper.file_close s@   ==A dnn OO '5 rHcUR5 URR5 g![5a gf=frJ)rr`rrrs rGrftpwrapper.real_close s5   HHNN {   s ->>) rrr`r|rrrrrDr)NT) rrrrrFrrrrrrrrrrHrGrr[ s/E?C  *!X  rHrc0n/n[RH~n[U5S:dMUSS:XdMUSSR5S:XdM8[RUnUSSR5nUR X#U45 U(dMzX0U'M S[R;aUR SS5 UH0up#nUSSS :XdMU(aX0U'MUR US5 M2 U$) aReturn a dictionary of scheme -> proxy server URL mappings. Scan the environment for variables named _proxy; this seems to be the standard convention. If you need a different way, you can pass a proxies dictionary to the [Fancy]URLopener constructor. rirNryREQUEST_METHODr_proxy)rXenvironrbrzr_r)r environmentr]r proxy_names rGgetproxies_environmentr sGK  t9q=T"X_bc1Bg1MJJt$Ecr*J   Z8 9u&+ #2::% FD!#.Z 9 &+ # J- $/ NrHcUc [5nUSnUS:XagUR5n[U5up4UR S5H|nUR 5nU(dMUR S5nUR5nX5:XdX:Xa gSU-nURU5(dURU5(dM| g g![a gf=f)zTest if proxies should not be used for a particular host. Checks the proxy dict for the value of no_proxy, which should be a list of comma separated DNS suffixes, or '*' for all hosts. noF*TrB.)rrCrzrrrlstripr)r|rno_proxyhostonlyrr]s rGproxy_bypass_environmentr$ s(*4=3 ::.ip2num sm S!Se_% u:?\)2A.EaB58r>2eAh!mDuQxOOrHr exclude_simpleTN exceptionsrz(\d+(?:\.\d+)*)(/\d+)?rSr;r/ F) r' ipaddressr(r)rr`rrrgroupcount) r|proxy_settingsr'r(r)r#rr-hostIPrrVrmasks rG_proxy_bypass_macosx_sysconfr8 s. 8%NHP $ * + F [*+ ##L"5h HH. 6 =V/!''!*%D771:D|AGGAJ,,S1A5648}ax4"99DDL12T ! !/62 9    sDDDcSSKJn [U5upURS5nUH2nUR5nUS:Xa SU;a gM#U"X5(dM2 g g)zReturn True if the host should bypass the proxy server. The proxy override list is obtained from the Windows Internet settings proxy override registry value. An example of a proxy override value is: "www.example.com;*.example.net; 192.168.0.1" rr&rzr TF)r'rrr)r|overrider'rproxy_overriders rG_proxy_bypass_winreg_overrider<I s` GD^^C(Nzz| 9 $ T  rHdarwin)_get_proxy_settings _get_proxiesc,[5n[X5$rJ)r>r8)r|r5s rGproxy_bypass_macosx_sysconfrAd s,.+DAArHc[5$)zReturn a dictionary of scheme -> proxy server URL mappings. This function uses the MacOSX framework SystemConfiguration to fetch the proxy information. )r?rrHrGgetproxies_macosx_sysconfrCh s ~rHcP[5nU(a [X5$[U5$)zReturn True, if host should be bypassed. Checks proxy settings gathered from the environment, if specified, or from the MacOSX framework SystemConfiguration. )rr$rAr|rs rGrrr s%)* +D: :.t4 4rHc8[5=(d [5$rJ)rrCrrHrGr6r6 s%'F+D+FFrHc0nSSKnURURS5nUR US5SnU(Ga [ UR US5S5nSU;aSU;aSR U5nURS5HNnURSS 5upg[R"S U5(dUS ;aS U-nO US :XaSU-nXpU'MP URS 5(aU[R"SSUS 5nURS5=(d UUS'URS5=(d UUS'UR5 U$![a Us$f=f![[[4a U$f=f)zhReturn a dictionary of scheme -> proxy server URL mappings. Win32 uses the registry to store proxies. rN;Software\Microsoft\Windows\CurrentVersion\Internet Settings ProxyEnable ProxyServerrrzhttp={0};https={0};ftp={0}rSz (?:[^/:]+)://)rrr`rsockszsocks://z ^socks://z socks4://rr)winreg ImportErrorOpenKeyHKEY_CURRENT_USER QueryValueExr rrrrrryCloserqrr)rrLinternetSettings proxyEnable proxyServerpraddresss rGgetproxies_registryrW s   " %~~f.F.FN P  --.>/<>>?AK!&"5"56F7D#FFG#IJ k)c.D">"E"Ek"RK$**3/A()Q%H88OW==#'??&/'&9G%0&07&:G(/H%0;;w'' ff\;@PQG&-kk&&9&DWGFO'.{{7';'FwGG$  " " $ M N BY/    s#EEE/ E,+E,/FFc8[5=(d [5$)zReturn a dictionary of scheme -> proxy server URL mappings. Returns settings gathered from the environment, if specified, or the registry. )rrWrrHrGr6r6 s&'@+>+@@rHc SSKnURURS5nUR US5Sn[ UR US5S5nU(aU(dg[X5$![a gf=f![ a gf=f)NrFrHrI ProxyOverride)rLrMrNrOrPr rqr<)r|rLrRrS proxyOverrides rGproxy_bypass_registryr\ s   %~~f.F.FN P  --.>/<>>?AK 3 34D5D!FFG!IJM -,TAA    s#A0AB0 A=<A= B  B cP[5nU(a [X5$[U5$)zReturn True, if host should be bypassed. Checks proxy settings gathered from the environment, if specified, or the registry. )rr$r\rEs rGrr s%)* +D: :(. .rHrrJ)~rFrrrr4 http.clientrr!rXrr#rhr r1r[rUr urllib.errorrrr urllib.parserrrr r r r r rrrrrrrrrrurllib.responserrsslrrM__all__ version_inforr@r$r1r2r^r7r8rASCIIrxr}rrr3rr0rrrr r!r"r#r$r%r&urandomr3r'r(r)rir*rr'r?r_rr/r$r&r+rr,r-r.rr] nturl2pathr5r4r=r9r:rrrrrrrrrrr$r8r<platform_scproxyr>r?rArCrr6rWr\rrHrGrjsCf  CB""""" 5I $((!,, F$B$B3+3+j:x zz(BHH-  k"k"ZI+I+^"H88&##";k;o2+o2d,B)>;)>V=*=*@GoG3#B3>k#k#^3[ 4k  zz OOdK)B$ [*C s+sl3%3 4;;)**8*8$ NN>"#+#$6[6 )*V11+11f 7,7,r3j3j:+:B 77d?55 C A ++DXYXz     aaH#J J<@0<<8:B 5GWW_/bAB( /(J+LeSIs:KK&%K&