b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 172.67.192.52 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 /
Filename/usr/lib64/python2.6/urllib.pyo
Size50.05 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 05:38
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc"@s¡dZddkZddkZddkZddkZddkZddklZdddddd d
d d d
ddddddddddddddddddgZ d Z
d!Z ei d"jodd#k
lZlZngei d$jodd#klZlZn=ei d%jodd#klZlZnd&�Zd'�Zeaeed(�Zeeed)�Zd*�ZyddkZWn
eZnXeZd+efd,��YZhZdfd-��YZdefd.��YZea d/�Z!ea"d0�Z#ea$d1�Z%ea&d2�Z'd3fd4��YZ(d5fd6��YZ)d7e)fd8��YZ*d9e)fd:��YZ+d;e)fd<��YZ,ye-Wne.j
od=�Z/n Xd>�Z/d?�Z0d@�Z1ea2dA�Z3ea4dB�Z5ea6dC�Z7ea8dD�Z9ea:dE�Z;ea<ddF�Z=ea>dG�Z?ea@dH�ZAdI�ZBeaCdJ�ZDdKZEeFdL�eED��ZGdM�ZHdN�ZIdOZJhZKdPdQ�ZLdRdS�ZMdTdU�ZNdV�ZOdW�ZPeiQdXjo>ddYkRlSZSlTZTdZ�ZUd[�ZVd\�ZWd]�ZXnEei d$jo(d^�ZYd_�ZXd`�ZZda�ZWn
eOZXePZWdb�Z[dc�Z\gdd�Z]de�Z^e_dfjo e^�ndS(gs»Open an arbitrary URL.

See the following document for more info on URLs:
"Names and Addresses, URIs, URLs, URNs, URCs", at
http://www.w3.org/pub/WWW/Addressing/Overview.html

See also the HTTP spec (from which the error codes are derived):
"HTTP - Hypertext Transfer Protocol", at
http://www.w3.org/pub/WWW/Protocols/

Related standards and specs:
- RFC1808: the "relative URL" spec. (authoritative status)
- RFC1738 - the "URL standard". (authoritative status)
- RFC1630 - the "URI spec". (informational status)

The object returned by URLopener().open(file) will differ per
protocol. All you know is that is has methods read(), readline(),
readlines(), fileno(), close() and info(). The read*(), fileno()
and close() methods work like those of open files.
The info() method returns a mimetools.Message object which can be
used to query various info about the object, if available.
(mimetools.Message objects are queried with the getheader() method.)
iÿÿÿÿN(turljointurlopent URLopenertFancyURLopenert urlretrievet
urlcleanuptquotet
quote_plustunquotet unquote_plust urlencodet url2pathnamet pathname2urltsplittagt localhosttthishostt ftperrorstbasejointunwrapt splittypet splithostt splitusert splitpasswdt splitportt
splitnportt
splitqueryt splitattrt
splitvaluet
getproxiess1.17i
tmac(R R tnttriscoscCs
t|�S(sOS-specific conversion from a relative URL of the 'file' scheme
to a file system path; not recommended for general use.(R(tpathname((s/usr/lib64/python2.6/urllib.pyR 4scCs
t|�S(sOS-specific conversion from a file system path to a relative URL
of the 'file' scheme; not recommended for general use.(R(R ((s/usr/lib64/python2.6/urllib.pyR 9scCs�ddkl}|ddd�|dj otd|�}n!tpt�}|ant}|djo|i|�S|i||�SdS(s=Create a file-like object for the specified URL to read from.iÿÿÿÿ(twarnpy3ksMurllib.urlopen() has been removed in Python 3.0 in favor of urllib2.urlopen()t
stacklevelitproxiesN(twarningsR!tNoneRt
_urlopenertopen(turltdataR#R!topener((s/usr/lib64/python2.6/urllib.pyRGs 
 

cCs*tp
t�anti||||�S(N(R&Rtretrieve(R(tfilenamet
reporthookR)((s/usr/lib64/python2.6/urllib.pyRYs
cCs-toti�nti�ti�dS(N(R&tcleanupt _safemapstcleartftpcache(((s/usr/lib64/python2.6/urllib.pyR^s
tContentTooShortErrorcBseZd�ZRS(cCsti||�||_dS(N(tIOErrort__init__tcontent(tselftmessageR5((s/usr/lib64/python2.6/urllib.pyR4ns(t__name__t
__module__R4(((s/usr/lib64/python2.6/urllib.pyR2mscBsãeZdZdZdeZdd�Zd�Zd�Z d�Z
d�Z dd�Z dd�Z
dd �Zdddd
�Zdd �Zdd �Zd
�Zeodd�Znd�Zd�Zd�Zdd�ZRS(s,Class 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).sPython-urllib/%scKs�|djo
t�}n||_|id�|_|id�|_d|ifg|_g|_t i
|_ d|_ t
|_
dS(Ntkey_filet cert_files
User-Agent(R%RR#tgetR:R;tversiont
addheaderst_URLopener__tempfilestostunlinkt_URLopener__unlinkt tempcacheR1(R6R#tx509((s/usr/lib64/python2.6/urllib.pyR4�s

    cCs|i�dS(N(tclose(R6((s/usr/lib64/python2.6/urllib.pyt__del__�scCs|i�dS(N(R.(R6((s/usr/lib64/python2.6/urllib.pyRE�scCso|ioFx8|iD]-}y|i|�Wqtj
oqXqW|i2n|io|ii�ndS(N(R?RBtOSErrorRCR0(R6tfile((s/usr/lib64/python2.6/urllib.pyR.�s

  
cGs|ii|�dS(sdAdd a header to be used by the HTTP interface only
e.g. u.addheader('Accept', 'sound/basic')N(R>tappend(R6targs((s/usr/lib64/python2.6/urllib.pyt addheader«scCsÅtt|��}t|dd�}|ioC||ijo3|i|\}}t|d�}t|||�St|�\}}|p
d}n||ijoA|i|}t|�\}} t| �\}
} |
|f}nd
}d|} ||_
| i dd�} t || �p/|o|i
|||�S|i||�Sny;|d
jot|| �|�St|| �||�SWn4tij
o%}
td|
fti�d �nXd
S( s6Use URLopener().open(file) instead of open(file, 'r').tsafes%/:=&?~#+!$,;'@()*[]|trbRHtopen_t-t_s socket erroriN(RttoBytesRRCR't
addinfourlRR#RR%ttypetreplacethasattrtopen_unknown_proxyt open_unknowntgetattrtsocketterrorR3tsystexc_info(R6tfullurlR)R,theaderstfpturltypeR(tproxyt proxyhostthosttselectortnametmsg((s/usr/lib64/python2.6/urllib.pyR'±s8


 
cCs(t|�\}}tdd|f�dS(s/Overridable interface to open unknown URL type.s url errorsunknown url typeN(RR3(R6R]R)RSR(((s/usr/lib64/python2.6/urllib.pyRWÕscCs,t|�\}}tdd||f�dS(s/Overridable interface to open unknown URL type.s url errorsinvalid proxy for %sN(RR3(R6RaR]R)RSR(((s/usr/lib64/python2.6/urllib.pyRVÚscCstt|��}|io||ijo |i|St|�\}}|djom| p
|djoXy<|i|�}|i�}~tt|�d�|fSWqÄt j
o } qÄXn|i
||�}zÜ|i�}
|ot
|d�} n·ddk } t|�\}
}t|pd�\}
}t |pd�\}}
t
|pd�\}}
tii|�d}| i|�\}}|ii|�ti|d�} zî||
f}|idj o||i|<nd
}d}d }d }|o5d
|
jot|
d �}n||||�nxf|i|�}|djoPn|t|�7}| i|�|d7}|o||||�q<q<Wd| i�XWd|i�X~~ |d jo*||jotd ||f|��n|S(stretrieve(url) returns (filename, headers) for a local object
or (tempfilename, headers) for a remote object.RHitwbiÿÿÿÿNtiiiscontent-lengthsContent-Lengths1retrieval incomplete: got only %i out of %i bytesi (RRQRCRR%topen_local_filetinfoR RR3R'ttempfileRRR@tpathtsplitexttmkstempR?RItfdopentinttreadtlentwriteRER2(R6R(R,R-R)RSturl1R_thdrsRfR^ttfpRktgarbageRltsuffixtfdtresulttbstsizeRqtblocknumtblock((s/usr/lib64/python2.6/urllib.pyR+àsn "     



 c Cs{ddk}d}d}t|t�oEt|�\}}|o"t|�\}}t|�}n|}n¾|\}}t|�\}}t|�\} }
|
}d}| i�djo
d}net|
�\}}
|ot|�\}}n|od| ||
f}nt |�o
|}n|p
t
d�n|o%ddk } | i |�i
�} nd} |o%ddk } | i |�i
�}
nd}
|i|�}|dj o>|id|�|idd �|id
d t|��n|id |�| o|id
d| �n|
o|idd|
�n|o|id|�nx|iD]}|i|�qoW|i�|dj o|i|�n|i�\}}}|i�}|djo"|o|i�nt
d�nd|jo
djnot||d||�S|djo|i|||||�S|i||||||�SdS(sUse HTTP protocol.iÿÿÿÿNthttps %s://%s%ss
http errors
no host giventPOSTs Content-Types!application/x-www-form-urlencodedsContent-Lengths%dtGETsProxy-AuthorizationsBasic %st
AuthorizationtHostshttp protocol errorisgot a bad status lineiÈi,shttp:(s
http errors
no host given(shttp protocol errorisgot a bad status lineN(thttplibR%t
isinstancetstrRRRRtlowert proxy_bypassR3tbase64t b64encodetstriptHTTPt
putrequestt putheaderRrR>t
endheaderstsendtgetreplytgetfileRERRt
http_error(R6R(R)R�t user_passwdt proxy_passwdRcRdtrealhostR`trestR�t
proxy_authtauththRJterrcodeterrmsgR^R_((s/usr/lib64/python2.6/urllib.pyt open_http#s~ 
 



  



 


c
Cs�d|}t||�oct||�}|djo||||||�} n|||||||�} | o| Sn|i|||||�S(s�Handle http errors.
Derived class can override this, or provide specific handlers
named http_error_DDD where DDD is the 3-digit error code.s
http_error_%dN(RURXR%thttp_error_default(
R6R(R_R�R�R^R)RetmethodRz((s/usr/lib64/python2.6/urllib.pyR�ns

 cCs/|i�}|i�td|||f�dS(s>Default error handler: close the connection and raise IOError.s
http errorN(RqRER3(R6R(R_R�R�R^tvoid((s/usr/lib64/python2.6/urllib.pyR�}s 
c Csyddk}d}d}t|t�oEt|�\}}|o"t|�\}}t|�}n|}n§|\}}t|�\}}t|�\} }
|
}d}| i�djo
d}nNt|
�\}}
|ot|�\}}n|od| ||
f}n|p
t d�n|o%ddk
} | i |�i �} nd} |o%ddk
} | i |�i �}
nd}
|i
|dd|id |i�}|dj o>|id
|�|id d �|id
dt|��n|id|�| o|idd| �n|
o|idd|
�n|o|id|�nx|iD]}|i|�qmW|i�|dj o|i|�n|i�\}}}|i�}|djo"|o|i�nt d�nd|jo
djnot||d||�S|djo|i|||||�S|i||||||�SdS(sUse HTTPS protocol.iÿÿÿÿNthttpss %s://%s%ss https errors
no host giveniR:R;R�s Content-Types!application/x-www-form-urlencodedsContent-Lengths%dR�sProxy-AuthorizationsBasic %sR�R�shttp protocol errorsgot a bad status lineiÈi,shttps:(s https errors
no host given(shttp protocol errorisgot a bad status lineN(R�R%R�R�RRRRR�R3R�R�R�tHTTPSR:R;R�R�RrR>R�R�R�R�RERRR�(R6R(R)R�R�R�RcRdR�R`R�R�R�R�R�RJR�R�R^R_((s/usr/lib64/python2.6/urllib.pyt
open_https�s� 
 

    
 


 


cCs{t|t�p
td
�n|d djo<|dd!djo(|dd!i�djo|i|�S|i|�Sd S( s/Use local file or FTP depending on form of URL.s
file errors9proxy support for file protocol currently not implementedis//it/i s
localhost/N(s
file errors9proxy support for file protocol currently not implemented(R�R�R3R�topen_ftpRi(R6R(((s/usr/lib64/python2.6/urllib.pyt open_fileÎs

?cCsðddk}ddk}ddk}yddkl}Wn#tj
oddkl}nXt|�\}}t|�}yti |�} Wn0t
j
o$}
t |
i |
i
|
i��nX| i} |ii| idt�} |i|�d}
|i|d|
pd| | f��}|p?|}|d d jod
|}ntt|d �||�St|�\}}| oati|�t�t�fjo?|}|d d jod
|}ntt|d �||�St d�dS(sUse local file.iÿÿÿÿN(tStringIOtusegmtis6Content-Type: %s
Content-Length: %d
Last-modified: %s
s
text/plainiR¤sfile://RMslocal file errorsnot on local host(slocal file errorsnot on local host(t mimetypest mimetoolst email.utilst cStringIOR§t ImportErrorRR R@tstatRGR3terrnotstrerrorR,tst_sizetutilst
formatdatetst_mtimetTruet
guess_typetMessageRRR'RRYt
gethostbynameRR(R6R(R©RªtemailR§RcRHt localnametstatsteR|tmodifiedtmtypeR^turlfiletport((s/usr/lib64/python2.6/urllib.pyRi×s@$     " cCsÔt|t�p
td�nddk}ddk}yddkl}Wn#tj
oddkl}nXt|�\}}|p
td�nt |�\}}t
|�\}}|ot |�\}} nd} t
|�}t
|pd�}t
| pd�} ti|�}|pddk}
|
i}n
t|�}t|�\}} t
|�}|id�} | d | d} }
| o| d  o| d
} n| o| d  od| d <n|||di| �f}t|i�tjoPxM|ii�D]8}||jo%|i|}|i|=|i�qqWnyK||ijo#t|| ||| �|i|<n|
p
d }nd }xP| D]H}t|�\}}|i�d
jo|djo|i�}q¢q¢W|i|i|
|�\}}|i d|�d }d}|o|d|7}n|dj o|d jo|d|7}n|i!||��}t"||d|�SWn4t#�j
o%}td|ft$i%�d�nXdS(sUse FTP protocol.s ftp errors8proxy support for ftp protocol currently not implementediÿÿÿÿN(R§s
no host givenRhR¤iitDtIRStatAtitdsftp:sContent-Type: %s
sContent-Length: %d
i(s ftp errors8proxy support for ftp protocol currently not implemented(s ftp errors
no host given(RÃRÄRÅRÂRÆRÁ(&R�R�R3R©RªR¬R§R­RRRRR%RRYR¸tftplibtFTP_PORTRpRtsplittjoinRrR1t MAXFTPCACHEtkeysREt
ftpwrapperRR�tuppertretrfileR¶R·RRRR[R\(R6R(R©RªR§RcRlRÀtusertpasswdRÇtattrstdirsRHtkeytktvRStattrtvalueR_tretrlenR¾R^Rf((s/usr/lib64/python2.6/urllib.pyR¥ús|

  
  


#

c Csçt|t�p
td�nddk}yddkl}Wn#tj
oddkl}nXy|idd�\}}Wntj
otd�nX|p
d }n|i d
�}|d jo-d ||jo||d}|| }nd
}g}|i
dt i dt i
t i ����|i
d|�|djoddk} | i|�}n
t|�}|i
dt|��|i
d
�|i
|�di|�}||�}
|i|
d �} t|
| |�S(sUse "data" URL.s
data errors9proxy support for data protocol currently not implementediÿÿÿÿN(R§t,is bad data URLstext/plain;charset=US-ASCIIt;it=RhsDate: %ss%a, %d %b %Y %H:%M:%S GMTsContent-type: %sR�sContent-Length: %ds
(s
data errors9proxy support for data protocol currently not implemented(s
data errors bad data URL(R�R�R3RªR¬R§R­RÉt
ValueErrortrfindRIttimetstrftimetgmtimeR�t decodestringRRrRÊR·RR( R6R(R)RªR§RStsemitencodingRfR�tfR^((s/usr/lib64/python2.6/urllib.pyt open_data8sB
 

  

 N(R8R9t__doc__R%R?t __version__R=R4RFRER.RKR'RWRVR+R�R�R�t _have_sslR£R¦RiR¥Ræ(((s/usr/lib64/python2.6/urllib.pyRss*
      $  C K  J # >cBs¶eZdZd�Zd�Zdd�Zd�Zdd�Zdd�Z dd�Z
dd�Z dd �Z dd
�Z
dd �Zdd �Zdd
�Zdd�Zd�ZRS(s?Derived class with handlers for errors we can handle (perhaps).cOs2ti|||�h|_d|_d|_dS(Nii
(RR4t
auth_cachettriestmaxtries(R6RJtkwargs((s/usr/lib64/python2.6/urllib.pyR4js  cCst||d||�S(s3Default error handling -- don't raise an exception.shttp:(RR(R6R(R_R�R�R^((s/usr/lib64/python2.6/urllib.pyR�psc Cs�|id7_|ioY|i|ijoFt|d�o
|i}n
|i}d|_|||dd|�S|i||||||�}d|_|S(s%Error 302 -- relocated (temporarily).ithttp_error_500iiôs)Internal Server Error: Redirect Recursion(RëRìRURîR�tredirect_internal( R6R(R_R�R�R^R)tmethRz((s/usr/lib64/python2.6/urllib.pythttp_error_302ts
      c
CsÔd|jo|d}n d|jo|d}ndS|i�}|i�t|id||�}|i�} | id�p| id�p
| id�p!td||d||��n|i|�S( Ntlocationturit:shttp://shttps://sftp://sredirect errors) - Redirection to url '%s' is not allowed(RqRERRSR�t
startswithR3R'(
R6R(R_R�R�R^R)tnewurlR t newurl_lower((s/usr/lib64/python2.6/urllib.pyRï�s"

 
  
cCs|i||||||�S(s*Error 301 -- also relocated (permanently).(Rñ(R6R(R_R�R�R^R)((s/usr/lib64/python2.6/urllib.pythttp_error_301�scCs|i||||||�S(s;Error 303 -- also relocated (essentially identical to 302).(Rñ(R6R(R_R�R�R^R)((s/usr/lib64/python2.6/urllib.pythttp_error_303¡scCsG|djo|i||||||�S|i|||||�SdS(s1Error 307 -- relocated, but turn POST into error.N(R%RñR�(R6R(R_R�R�R^R)((s/usr/lib64/python2.6/urllib.pythttp_error_307¥s
c
Csd|jo ti||||||�n|d}ddk}|id|�} | p ti||||||�n| i�\}
} |
i�djo ti||||||�nd|id} |djot|| �|| �St|| �|| |�SdS(s_Error 401 -- authentication required.
This function supports Basic authentication only.swww-authenticateiÿÿÿÿNs![ ]*([^ ]+)[ ]+realm="([^"]*)"tbasictretry_t _basic_auth( RR�tretmatchtgroupsR�RSR%RX(
R6R(R_R�R�R^R)tstuffRþRÿtschemetrealmRe((s/usr/lib64/python2.6/urllib.pythttp_error_401¬s"

 
c
Csd|jo ti||||||�n|d}ddk}|id|�} | p ti||||||�n| i�\}
} |
i�djo ti||||||�nd|id} |djot|| �|| �St|| �|| |�SdS(seError 407 -- proxy authentication required.
This function supports Basic authentication only.sproxy-authenticateiÿÿÿÿNs![ ]*([^ ]+)[ ]+realm="([^"]*)"Rût retry_proxy_Rý( RR�RþRÿRR�RSR%RX(
R6R(R_R�R�R^R)RRþRÿRRRe((s/usr/lib64/python2.6/urllib.pythttp_error_407Âs"

 
cCst|�\}}d||}|id}t|�\}} t| �\} }
| id�d} | | } |i| || �\} }
| p|
pdSt| dd�dt|
dd�d| } d| |
|id<|djo|i|�S|i||�SdS(Nshttp://Rt@iRLRhRô(RR#Rtfindtget_user_passwdR%RR'(R6R(RR)RcRdRöRaR`Rbt
proxyselectorRÅRÐRÑ((s/usr/lib64/python2.6/urllib.pytretry_proxy_http_basic_authØs

.
cCst|�\}}d||}|id}t|�\}} t| �\} }
| id�d} | | } |i| || �\} }
| p|
pdSt| dd�dt|
dd�d| } d| |
|id<|djo|i|�S|i||�SdS(Nshttps://R¡RiRLRhRô(RR#RRR R%RR'(R6R(RR)RcRdRöRaR`RbR
RÅRÐRÑ((s/usr/lib64/python2.6/urllib.pytretry_proxy_https_basic_authés

.
c
CsÈt|�\}}|id�d}||}|i|||�\}}|p|pdSt|dd�dt|dd�d|}d||} |djo|i| �S|i| |�SdS(NRiRLRhRôshttp://(RRR R%RR'(
R6R(RR)RcRdRÅRÐRÑRö((s/usr/lib64/python2.6/urllib.pytretry_http_basic_authús
.
c
CsÈt|�\}}|id�d}||}|i|||�\}}|p|pdSt|dd�dt|dd�d|}d||} |djo|i| �S|i| |�SdS(NRiRLRhRôshttps://(RRR R%RR'(
R6R(RR)RcRdRÅRÐRÑRö((s/usr/lib64/python2.6/urllib.pytretry_https_basic_auths
.
icCs�|d|i�}||ijo$|o|i|=qH|i|Sn|i||�\}}|p|o||f|i|<n||fS(NR(R�Rêtprompt_user_passwd(R6RcRt clear_cacheRÔRÐRÑ((s/usr/lib64/python2.6/urllib.pyR sc Cshddk}y@td||f�}|id|||f�}||fSWntj
o HdSXdS(s#Override this in a GUI environment!iÿÿÿÿNsEnter username for %s at %s: s#Enter password for %s in %s at %s: (NN(tgetpasst raw_inputtKeyboardInterruptR%(R6RcRRRÐRÑ((s/usr/lib64/python2.6/urllib.pyRs  
 N(R8R9RçR4R�R%RñRïRøRùRúRRR R R
RR R(((s/usr/lib64/python2.6/urllib.pyRgs            

cCs$tdjotid�antS(s8Return the IP address of the magic hostname 'localhost'.RN(t
_localhostR%RYR¸(((s/usr/lib64/python2.6/urllib.pyR0s
cCs*tdjotiti��antS(s*Return the IP address of the current host.N(t _thishostR%RYR¸t gethostname(((s/usr/lib64/python2.6/urllib.pyR8s
cCs*tdjoddk}|iantS(s1Return the set of errors raised by the FTP class.iÿÿÿÿN(t
_ftperrorsR%RÇt
all_errors(RÇ((s/usr/lib64/python2.6/urllib.pyR@s
 
cCs}tdjolddk}yddkl}Wn#tj
oddkl}nX|i|�d�atii�ntS(s)Return an empty mimetools.Message object.iÿÿÿÿN(R§i( t
_noheadersR%RªR¬R§R­R·R_RE(RªR§((s/usr/lib64/python2.6/urllib.pyt noheadersIs
 RÍcBsAeZdZeid�Zd�Zd�Zd�Zd�Z RS(s;Class used by open_ftp() for cache of open FTP connections.cCsD||_||_||_||_||_||_|i�dS(N(RÐRÑRcRÀRÓttimeouttinit(R6RÐRÑRcRÀRÓR((s/usr/lib64/python2.6/urllib.pyR4\s      cCs�ddk}d|_|i�|_|ii|i|i|i�|ii|i |i
�x!|i D]}|ii |�qfWdS(Niÿÿÿÿi(
RÇtbusytFTPtftptconnectRcRÀRtloginRÐRÑRÓtcwd(R6RÇtdir((s/usr/lib64/python2.6/urllib.pyRfs  
c Csÿddk}|i�|djod}d}nd|}d}y|ii|�Wn0|ij
o!|i�|ii|�nXd}|o~| ovy d|}|ii|�}Wq|ij
o@}t |�d d
jo t
d |ft i �d �qqXn|p³|iid�|o�|ii
�}zOy|ii|�Wn4|ij
o%}t
d |ft i �d �nXWd|ii|�Xd
|}nd}|ii|�}nd|_t|did�|i�|dfS(NiÿÿÿÿRÆRÁsTYPE AisTYPE isRETR it550s ftp errorisLIST tLISTRM(RÆRÁ(RÇt endtransferRtvoidcmdRRR%t ntransfercmdt
error_permR�R3R[R\tpwdR"Rt addclosehooktmakefile( R6RHRSRÇtcmdtisdirtconntreasonR*((s/usr/lib64/python2.6/urllib.pyRÏosH 





)% cCsF|ipdSd|_y|ii�Wnt�j
onXdS(Ni(RRtvoidrespR(R6((s/usr/lib64/python2.6/urllib.pyR&�s
 cCs8|i�y|ii�Wnt�j
onXdS(N(R&RRER(R6((s/usr/lib64/python2.6/urllib.pyRE s

(
R8R9RçRYt_GLOBAL_DEFAULT_TIMEOUTR4RRÏR&RE(((s/usr/lib64/python2.6/urllib.pyRÍYs  ( taddbasecBs)eZdZd�Zd�Zd�ZRS(s(Base class for addinfo and addclosehook.cCsÏ||_|ii|_|ii|_t|id�o|ii|_nt|id�o|ii|_n
d�|_t|id�o9|ii|_t|id�o|ii|_qËndS(Nt readlinestfilenocSsdS(N(R%(((s/usr/lib64/python2.6/urllib.pyt<lambda>²st__iter__tnext(R_RqtreadlineRUR4R5R7R8(R6R_((s/usr/lib64/python2.6/urllib.pyR4ªs  cCs d|iit|�|ifS(Ns<%s at %r whose fp = %r>(t __class__R8tidR_(R6((s/usr/lib64/python2.6/urllib.pyt__repr__¸s cCsLd|_d|_d|_d|_|io|ii�nd|_dS(N(R%RqR9R4R5R_RE(R6((s/usr/lib64/python2.6/urllib.pyRE¼s    
(R8R9RçR4R<RE(((s/usr/lib64/python2.6/urllib.pyR3§s  R+cBs eZdZd�Zd�ZRS(s*Class to add a close hook to an open file.cGs&ti||�||_||_dS(N(R3R4t closehookthookargs(R6R_R=R>((s/usr/lib64/python2.6/urllib.pyR4Çs cCsAti|�|io&|i|i�d|_d|_ndS(N(R3RER=R>R%(R6((s/usr/lib64/python2.6/urllib.pyREÌs


 (R8R9RçR4RE(((s/usr/lib64/python2.6/urllib.pyR+Äs taddinfocBs eZdZd�Zd�ZRS(s.class to add an info() method to an open file.cCsti||�||_dS(N(R3R4R^(R6R_R^((s/usr/lib64/python2.6/urllib.pyR4ÖscCs|iS(N(R^(R6((s/usr/lib64/python2.6/urllib.pyRjÚs(R8R9RçR4Rj(((s/usr/lib64/python2.6/urllib.pyR?Ós RRcBs5eZdZdd�Zd�Zd�Zd�ZRS(s9class to add info() and geturl() methods to an open file.cCs/ti||�||_||_||_dS(N(R3R4R^R(tcode(R6R_R^R(R@((s/usr/lib64/python2.6/urllib.pyR4às  cCs|iS(N(R^(R6((s/usr/lib64/python2.6/urllib.pyRjæscCs|iS(N(R@(R6((s/usr/lib64/python2.6/urllib.pytgetcodeéscCs|iS(N(R((R6((s/usr/lib64/python2.6/urllib.pytgeturlìsN(R8R9RçR%R4RjRARB(((s/usr/lib64/python2.6/urllib.pyRRÝs
   cCsdS(Ni((tx((s/usr/lib64/python2.6/urllib.pyt _is_unicodescCs
t|t�S(N(R�tunicode(RC((s/usr/lib64/python2.6/urllib.pyRDscCsXt|�oGy|id�}WqTtj
o!tdt|�d��qTXn|S(stoBytes(u"URL") --> 'URL'.tASCIIsURL s contains non-ASCII characters(RDtencodet UnicodeErrortrepr(R(((s/usr/lib64/python2.6/urllib.pyRQs
cCsn|i�}|d djo(|ddjo|dd!i�}n|d djo|di�}n|S(s8unwrap('<URL:type://host/path>') --> 'type://host/path'.it<iÿÿÿÿt>isURL:(R�(R(((s/usr/lib64/python2.6/urllib.pyRs  "cCsztdjoddk}|id�anti|�}|o.|id�}|i�|t|�dfSd|fS(s:splittype('type:opaquestring') --> 'type', 'opaquestring'.iÿÿÿÿNs
^([^/:]+):i(t _typeprogR%RþtcompileRÿtgroupR�Rr(R(RþRÿR((s/usr/lib64/python2.6/urllib.pyRs
 cCs]tdjoddk}|id�anti|�}|o|idd�Sd|fS(s;splithost('//host[:port]/path') --> 'host[:port]', '/path'.iÿÿÿÿNs^//([^/?]*)(.*)$ii(t _hostprogR%RþRMRÿRN(R(RþRÿ((s/usr/lib64/python2.6/urllib.pyR+s
 cCsftdjoddk}|id�anti|�}|ott|idd��Sd|fS(sJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.iÿÿÿÿNs ^(.*)@(.*)$ii(t _userprogR%RþRMRÿtmapRRN(RcRþRÿ((s/usr/lib64/python2.6/urllib.pyR7s
 cCs]tdjoddk}|id�anti|�}|o|idd�S|dfS(s/splitpasswd('user:passwd') -> 'user', 'passwd'.iÿÿÿÿNs^([^:]*):(.*)$ii(t _passwdprogR%RþRMRÿRN(RÐRþRÿ((s/usr/lib64/python2.6/urllib.pyRCs
 cCs]tdjoddk}|id�anti|�}|o|idd�S|dfS(s*splitport('host:port') --> 'host', 'port'.iÿÿÿÿNs^(.*):([0-9]+)$ii(t _portprogR%RþRMRÿRN(RcRþRÿ((s/usr/lib64/python2.6/urllib.pyRPs
 cCs¯tdjoddk}|id�anti|�}|oc|idd�\}}y$|p
td�nt|�}Wntj
o
d}nX||fS||fS(sÛSplit host and port, returning numeric port.
Return given default port if no ':' found; defaults to -1.
Return numerical port if a valid number are found after ':'.
Return None if ':' but not a valid number.iÿÿÿÿNs ^(.*):(.*)$iis no digits(t
_nportprogR%RþRMRÿRNRÝRp(RctdefportRþRÿRÀtnport((s/usr/lib64/python2.6/urllib.pyR\s
 
  cCs]tdjoddk}|id�anti|�}|o|idd�S|dfS(s/splitquery('/path?query') --> '/path', 'query'.iÿÿÿÿNs^(.*)\?([^?]*)$ii(t
_queryprogR%RþRMRÿRN(R(RþRÿ((s/usr/lib64/python2.6/urllib.pyRrs
 cCs]tdjoddk}|id�anti|�}|o|idd�S|dfS(s)splittag('/path#tag') --> '/path', 'tag'.iÿÿÿÿNs^(.*)#([^#]*)$ii(t_tagprogR%RþRMRÿRN(R(RþRÿ((s/usr/lib64/python2.6/urllib.pyR
~s
 cCs!|id�}|d|dfS(sksplitattr('/path;attr1=value1;attr2=value2;...') ->
'/path', ['attr1=value1', 'attr2=value2', ...].RÛii(RÉ(R(twords((s/usr/lib64/python2.6/urllib.pyR�scCs]tdjoddk}|id�anti|�}|o|idd�S|dfS(s-splitvalue('attr=value') --> 'attr', 'value'.iÿÿÿÿNs^([^=]*)=(.*)$ii(t
_valueprogR%RþRMRÿRN(R×RþRÿ((s/usr/lib64/python2.6/urllib.pyR�s
 t0123456789ABCDEFabcdefccsGx@|]9}x0tD](}||tt||d��fVqWqWdS(iN(t_hexdigtchrRp(t.0RÃtb((s/usr/lib64/python2.6/urllib.pys <genexpr>�s c Cs¿|id�}x tdt|��D]�}||}yt|d |d||<Wq%tj
od|||<q%tj
o,tt|d d��|d||<q%Xq%Wdi|�S(s"unquote('abc%20def') -> 'abc def'.t%iiiRh( RÉtxrangeRrt _hextochrtKeyErrortUnicodeDecodeErrortunichrRpRÊ(tstresRÅtitem((s/usr/lib64/python2.6/urllib.pyR�s
.cCs|idd�}t|�S(s%unquote('%7e/abc+def') -> '~/abc def't+t (RTR(Rf((s/usr/lib64/python2.6/urllib.pyR «ssAABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-R¤cCs®|tf}yt|}Wnrtj
of|t7}h}xBtd�D]4}t|�}||jo|pd|||<qHW|t|<nXt|i|�}di|�S(s quote('abc def') -> 'abc%20def'

Each part of a URL, e.g. the path info, the query, etc., has a
different set of reserved characters that must be quoted.

RFC 2396 Uniform Resource Identifiers (URI): Generic Syntax lists
the following reserved characters.

reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
"$" | ","

Each of these characters is reserved in some component of a URL,
but not necessarily in all of them.

By default, the quote function is intended for quoting the path
section of a URL. Thus, it will not encode '/'. This character
is reserved, but in typical usage the quote function is being
called on a path where the existing slash characters are used as
reserved characters.
is%%%02XRh(t always_safeR/RctrangeR]RQt __getitem__RÊ(RfRLtcachekeytsafe_mapRÅtcRg((s/usr/lib64/python2.6/urllib.pyRµs 

 &RhcCs>d|jo$t||d�}|idd�St||�S(s9Quote the query fragment of a URL; replacing ' ' with '+'RjRi(RRT(RfRL((s/usr/lib64/python2.6/urllib.pyR×s
ic

Cst|d�o|i�}nhy0t|�ot|dt� o
t�nWn4tj
o(ti�\}}}td|�nXg}|pTxl|D]E\}}tt |��}tt |��}|i
|d|�q�Wnx|D]\}}tt |��}t|t �o%t|�}|i
|d|�qït |�o1t|i dd��}|i
|d|�qïyt|�}Wn:tj
o.tt |��}|i
|d|�qïXx/|D]'} |i
|dtt | ���qÔWqïWdi
|�S(svEncode a sequence of two-element tuples or dictionary into a URL query string.

If any values in the query arg are sequences and doseq is true, each
sequence element is converted to a separate parameter.

If the query arg is a sequence of two-element tuples, the order of the
parameters in the output will match the order of parameters in the
input.
titemsis1not a valid non-string sequence or mapping objectRÜRFRTt&(RURqRrR�ttuplet TypeErrorR[R\RR�RIRDRGRÊ(
tquerytdoseqttytvattbtlRÕRÖRCtelt((s/usr/lib64/python2.6/urllib.pyR
ÞsB "   
)cCs�h}xStii�D]B\}}|i�}|o#|ddjo|||d <qqWdtijo|idd�n|S(sReturn a dictionary of scheme -> proxy server URL mappings.

Scan the environment for variables named <scheme>_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.

iúÿÿÿt_proxytREQUEST_METHODRN(R@tenvironRqR�tpopR%(R#ReRØ((s/usr/lib64/python2.6/urllib.pytgetproxies_environments
  cCs�tiidd�ptiidd�}|djodSt|�\}}xC|id�D]2}|o%|i|�p|i|�odSq_WdS(sÏTest if proxies should not be used for a particular host.

Checks the environment for a variable named no_proxy, which should
be a list of DNS suffixes separated by commas, or '*' for all hosts.
tno_proxyRhtNO_PROXYt*iRÚi(R@R~R<RRÉtendswith(RcR�thostonlyRÀRe((s/usr/lib64/python2.6/urllib.pytproxy_bypass_environment7s+
' tdarwin(t_get_proxy_settingst _get_proxiesc
Cs¯ddk}ddk}ddkl}t|�\}}d�}t�}d|jo|dotSnd}x5|idd
�D]!} | pq�n|id| �}
|
dj oÙ|djo?y|i |�}||�}Wq|i
j
o
q�qXn||
i d ��} |
i d
�} | djo$d |
i d �i d�d } nt
| d �} d | } || ?| | ?jotSq�||| �otSq�WtS(s¼
Return True iff this host shouldn't be accessed using a proxy

This function uses the MacOSX framework SystemConfiguration
to fetch the proxy information.
iÿÿÿÿN(tfnmatchcSs{|id�}tt|�}t|�djo|ddddgd }n|dd>|dd>B|dd>B|d BS(
Nt.iiiiiiii(RÉRQRpRr(tipAddrtparts((s/usr/lib64/python2.6/urllib.pytip2num[s
R�texclude_simplet
exceptionss(\d+(?:\.\d+)*)(/\d+)?iiii ((RþRYR�RR�RµR%R<RÿR¸RZRNtcountRptFalse(
RcRþRYR�R�RÀR�tproxy_settingsthostIPRØtmtbasetmask((s/usr/lib64/python2.6/urllib.pytproxy_bypass_macosx_sysconfNsB    
  

 
$
  cCst�S(s±Return a dictionary of scheme -> proxy server URL mappings.

This function uses the MacOSX framework SystemConfiguration
to fetch the proxy information.
(R�(((s/usr/lib64/python2.6/urllib.pytgetproxies_macosx_sysconf�scCs#t�o t|�St|�SdS(N(R�R�R�(Rc((s/usr/lib64/python2.6/urllib.pyR��s
 cCst�pt�S(N(R�R�(((s/usr/lib64/python2.6/urllib.pyR�sc Csyh}yddk}Wntj
o|SXy)|i|id�}|i|d�d}|oét|i|d�d�}d|josx¹|id�D][}|idd �\}}ddk}|id
|�pd ||f}n|||<q�WqK|d d
jo||d<qKd||d<d||d<d||d<n|i �Wnt
t t fj
onX|S(sxReturn a dictionary of scheme -> proxy server URL mappings.

Win32 uses the registry to store proxies.

iÿÿÿÿNs;Software\Microsoft\Windows\CurrentVersion\Internet Settingst ProxyEnableit ProxyServerRÜRÛis ^([^/:]+)://s%s://%sishttp:Rs http://%ss
https://%sR¡sftp://%sR(
t_winregR­tOpenKeytHKEY_CURRENT_USERt QueryValueExR�RÉRþRÿtCloset WindowsErrorRÝRt( R#R�tinternetSettingst proxyEnablet proxyServertptprotocoltaddressRþ((s/usr/lib64/python2.6/urllib.pytgetproxies_registry�s<   
 
 cCst�pt�S(s¥Return a dictionary of scheme -> proxy server URL mappings.

Returns settings gathered from the environment, if specified,
or the registry.

(R�R¨(((s/usr/lib64/python2.6/urllib.pyRÌsc
CsTyddk}ddk}Wntj
odSXyK|i|id�}|i|d�d}t|i|d�d�}Wntj
odSX| p| odSt|�\}}|g}y1t i
|�}||jo|i |�nWnt i j
onXy1t i
|�} | |jo|i | �nWnt i j
onX|id�}d}
xi|
t|�joU||
djo6dd t i�t i
t i��g||
|
d
+n|
d
7}
qqWxs|D]k} | id d �} | id
d�} | idd �} x,|D]$} |i| | |i�od
Sq$WqáWdS(Niÿÿÿÿis;Software\Microsoft\Windows\CurrentVersion\Internet SettingsR�t
ProxyOverrideRÛs<local>Rs 127.0.0.1iR�s\.R�s.*t?(R�RþR­R�R�R�R�R¡RRYR¸RIRZtgetfqdnRÉRrRRTRÿRÂ(
RcR�RþR¢R£t
proxyOverridetrawHostRÀtaddrtfqdnRÅttesttval((s/usr/lib64/python2.6/urllib.pytproxy_bypass_registryÕsf    
  

 !
cCs#t�o t|�St|�SdS(s¥Return a dictionary of scheme -> proxy server URL mappings.

Returns settings gathered from the environment, if specified,
or the registry.

N(R�R�R²(Rc((s/usr/lib64/python2.6/urllib.pyR�s
 cCs¸d}x$td�D]}|t|�}qW|d}ti�}t|�}t|�}ti�}||jo dGHnt|�GHt|�GHt|�GHt||d�GdGHdS(NRhiisWrong!itsec(RlR]RßRRRItround(RfRÅtt0tqstuqstt1((s/usr/lib64/python2.6/urllib.pyttest1"s

    
    cCsd|||fGHdS(Ns0Block number: %d, Block size: %d, Total size: %d((R}t blocksizet totalsize((s/usr/lib64/python2.6/urllib.pyR-2sc Cs9|p:dddddg}ttd�o|id�qAnzéxÙ|D]Ñ}dG|GdGHt|dt�\}}|GH|o6d
GHx%|i�D]}|d G||GHq�Wd
GHnt|d �}|i�}~d
|jo(t i
dd�}|i |d
�}n|GHd\}}qKWddGHWdt �XdS(Ns /etc/passwdsfile:/etc/passwdsfile://localhost/etc/passwdsftp://ftp.gnu.org/pub/READMEs http://www.python.org/index.htmlR£s!https://synergy.as.cmu.edu/~geek/ROi
s======RôRMs
Rhi(s
----------s
----------(NN(
RURRIRR%R-RÌR'Rqtstringt maketranst translateR(RJR(tfnR�RÕR_R)ttable((s/usr/lib64/python2.6/urllib.pyR°8s< 

  

c Csddk}ddk}y#|i|idd�\}}Wn#|ij
o}|GHdGHdSXd}xO|D]G\}}|djo|d}n|djodGHd Gd
GHdSqnW|o&|djo t�nt|�n2|p dGHnx|D]}t|�i�GqýWdS( NiÿÿÿÿitthsUse -h for helpis-ts-hs&Usage: python urllib.py [-t] [url ...]s-t runs self-test;s'otherwise, contents of urls are printed(tgetoptR[targvRZR¹R°RRq( RÂR[toptsRJRftttoRÃR(((s/usr/lib64/python2.6/urllib.pytmainXs4# 

 
  t__main__(`RçR¼RYR@RßR[turlparseRRt__all__RèRËRet macurl2pathR R t
nturl2patht
rourl2pathR%R&RRRtsslR�RéRµR3R2R1RRRRRRRRRRRÍR3R+R?RRREt NameErrorRDRQRRLRRORRPRRRRRSRRTRRWRRXR
RRZRR\tdictRbRR RkR/RRR
R�R�tplatformt_scproxyR�R�R�R�R�RR¨R²R¹R-R°RÇR8(((s/usr/lib64/python2.6/urllib.pyt<module>sÔ          
 
ÿõÈ    N
"  
        
 "  @   <

 . ;