/opt/alt/python34/lib64/python3.4/__pycache__
NameSizeModeActions
abc.cpython-34.pyc78770644editdlrm
abc.cpython-34.pyo78270644editdlrm
aifc.cpython-34.pyc279120644editdlrm
aifc.cpython-34.pyo279120644editdlrm
antigravity.cpython-34.pyc8470644editdlrm
antigravity.cpython-34.pyo8470644editdlrm
argparse.cpython-34.pyc658740644editdlrm
argparse.cpython-34.pyo657150644editdlrm
ast.cpython-34.pyc123600644editdlrm
ast.cpython-34.pyo123600644editdlrm
asynchat.cpython-34.pyc83590644editdlrm
asynchat.cpython-34.pyo83590644editdlrm
asyncore.cpython-34.pyc179630644editdlrm
asyncore.cpython-34.pyo179630644editdlrm
base64.cpython-34.pyc182970644editdlrm
base64.cpython-34.pyo180990644editdlrm
bdb.cpython-34.pyc186940644editdlrm
bdb.cpython-34.pyo186940644editdlrm
binhex.cpython-34.pyc135410644editdlrm
binhex.cpython-34.pyo135410644editdlrm
bisect.cpython-34.pyc28580644editdlrm
bisect.cpython-34.pyo28580644editdlrm
bz2.cpython-34.pyc151560644editdlrm
bz2.cpython-34.pyo151560644editdlrm
calendar.cpython-34.pyc275670644editdlrm
calendar.cpython-34.pyo275670644editdlrm
cgi.cpython-34.pyc298270644editdlrm
cgi.cpython-34.pyo298270644editdlrm
cgitb.cpython-34.pyc110640644editdlrm
cgitb.cpython-34.pyo110640644editdlrm
chunk.cpython-34.pyc52700644editdlrm
chunk.cpython-34.pyo52700644editdlrm
cmd.cpython-34.pyc134560644editdlrm
cmd.cpython-34.pyo134560644editdlrm
code.cpython-34.pyc97020644editdlrm
code.cpython-34.pyo97020644editdlrm
codecs.cpython-34.pyc351320644editdlrm
codecs.cpython-34.pyo351320644editdlrm
codeop.cpython-34.pyc64660644editdlrm
codeop.cpython-34.pyo64660644editdlrm
colorsys.cpython-34.pyc36590644editdlrm
colorsys.cpython-34.pyo36590644editdlrm
compileall.cpython-34.pyc73780644editdlrm
compileall.cpython-34.pyo73780644editdlrm
configparser.cpython-34.pyc448820644editdlrm
configparser.cpython-34.pyo448820644editdlrm
contextlib.cpython-34.pyc103700644editdlrm
contextlib.cpython-34.pyo103700644editdlrm
copy.cpython-34.pyc80610644editdlrm
copy.cpython-34.pyo79750644editdlrm
copyreg.cpython-34.pyc46070644editdlrm
copyreg.cpython-34.pyo45660644editdlrm
cProfile.cpython-34.pyc46220644editdlrm
cProfile.cpython-34.pyo46220644editdlrm
crypt.cpython-34.pyc24370644editdlrm
crypt.cpython-34.pyo24370644editdlrm
csv.cpython-34.pyc129970644editdlrm
csv.cpython-34.pyo129970644editdlrm
datetime.cpython-34.pyc562640644editdlrm
datetime.cpython-34.pyo542960644editdlrm
decimal.cpython-34.pyc1725260644editdlrm
decimal.cpython-34.pyo1725260644editdlrm
difflib.cpython-34.pyc605150644editdlrm
difflib.cpython-34.pyo604670644editdlrm
dis.cpython-34.pyc145870644editdlrm
dis.cpython-34.pyo145870644editdlrm
doctest.cpython-34.pyc801100644editdlrm
doctest.cpython-34.pyo798370644editdlrm
dummy_threading.cpython-34.pyc12140644editdlrm
dummy_threading.cpython-34.pyo12140644editdlrm
enum.cpython-34.pyc163390644editdlrm
enum.cpython-34.pyo163390644editdlrm
filecmp.cpython-34.pyc91200644editdlrm
filecmp.cpython-34.pyo91200644editdlrm
fileinput.cpython-34.pyc142970644editdlrm
fileinput.cpython-34.pyo142970644editdlrm
fnmatch.cpython-34.pyc31460644editdlrm
fnmatch.cpython-34.pyo31460644editdlrm
formatter.cpython-34.pyc189160644editdlrm
formatter.cpython-34.pyo189160644editdlrm
fractions.cpython-34.pyc192700644editdlrm
fractions.cpython-34.pyo192700644editdlrm
ftplib.cpython-34.pyc333220644editdlrm
ftplib.cpython-34.pyo333220644editdlrm
functools.cpython-34.pyc236140644editdlrm
functools.cpython-34.pyo236140644editdlrm
genericpath.cpython-34.pyc34930644editdlrm
genericpath.cpython-34.pyo34930644editdlrm
getopt.cpython-34.pyc67330644editdlrm
getopt.cpython-34.pyo66910644editdlrm
getpass.cpython-34.pyc46240644editdlrm
getpass.cpython-34.pyo46240644editdlrm
gettext.cpython-34.pyc151740644editdlrm
gettext.cpython-34.pyo151740644editdlrm
glob.cpython-34.pyc28800644editdlrm
glob.cpython-34.pyo28800644editdlrm
gzip.cpython-34.pyc194460644editdlrm
gzip.cpython-34.pyo193920644editdlrm
hashlib.cpython-34.pyc79440644editdlrm
hashlib.cpython-34.pyo79440644editdlrm
heapq.cpython-34.pyc139100644editdlrm
heapq.cpython-34.pyo139100644editdlrm
hmac.cpython-34.pyc51460644editdlrm
hmac.cpython-34.pyo51460644editdlrm
imaplib.cpython-34.pyc434790644editdlrm
imaplib.cpython-34.pyo409550644editdlrm
imghdr.cpython-34.pyc41430644editdlrm
imghdr.cpython-34.pyo41430644editdlrm
imp.cpython-34.pyc98670644editdlrm
imp.cpython-34.pyo98670644editdlrm
inspect.cpython-34.pyc763270644editdlrm
inspect.cpython-34.pyo760060644editdlrm
io.cpython-34.pyc34580644editdlrm
io.cpython-34.pyo34580644editdlrm
ipaddress.cpython-34.pyc629840644editdlrm
ipaddress.cpython-34.pyo629840644editdlrm
keyword.cpython-34.pyc19460644editdlrm
keyword.cpython-34.pyo19460644editdlrm
linecache.cpython-34.pyc31120644editdlrm
linecache.cpython-34.pyo31120644editdlrm
locale.cpython-34.pyc372760644editdlrm
locale.cpython-34.pyo372760644editdlrm
lzma.cpython-34.pyc159170644editdlrm
lzma.cpython-34.pyo159170644editdlrm
macpath.cpython-34.pyc60060644editdlrm
macpath.cpython-34.pyo60060644editdlrm
macurl2path.cpython-34.pyc21020644editdlrm
macurl2path.cpython-34.pyo21020644editdlrm
mailbox.cpython-34.pyc702880644editdlrm
mailbox.cpython-34.pyo701890644editdlrm
mailcap.cpython-34.pyc65440644editdlrm
mailcap.cpython-34.pyo65440644editdlrm
mimetypes.cpython-34.pyc168070644editdlrm
mimetypes.cpython-34.pyo168070644editdlrm
modulefinder.cpython-34.pyc173760644editdlrm
modulefinder.cpython-34.pyo172970644editdlrm
netrc.cpython-34.pyc42770644editdlrm
netrc.cpython-34.pyo42770644editdlrm
nntplib.cpython-34.pyc363100644editdlrm
nntplib.cpython-34.pyo363100644editdlrm
ntpath.cpython-34.pyc133050644editdlrm
ntpath.cpython-34.pyo133050644editdlrm
nturl2path.cpython-34.pyc17160644editdlrm
nturl2path.cpython-34.pyo17160644editdlrm
numbers.cpython-34.pyc126670644editdlrm
numbers.cpython-34.pyo126670644editdlrm
opcode.cpython-34.pyc51740644editdlrm
opcode.cpython-34.pyo51740644editdlrm
operator.cpython-34.pyc127780644editdlrm
operator.cpython-34.pyo127780644editdlrm
optparse.cpython-34.pyc515370644editdlrm
optparse.cpython-34.pyo514600644editdlrm
os.cpython-34.pyc295990644editdlrm
os.cpython-34.pyo295990644editdlrm
pathlib.cpython-34.pyc404830644editdlrm
pathlib.cpython-34.pyo404830644editdlrm
pdb.cpython-34.pyc494720644editdlrm
pdb.cpython-34.pyo494060644editdlrm
pickle.cpython-34.pyc469840644editdlrm
pickle.cpython-34.pyo468380644editdlrm
pickletools.cpython-34.pyc702540644editdlrm
pickletools.cpython-34.pyo691670644editdlrm
pipes.cpython-34.pyc84310644editdlrm
pipes.cpython-34.pyo84310644editdlrm
pkgutil.cpython-34.pyc176000644editdlrm
pkgutil.cpython-34.pyo176000644editdlrm
platform.cpython-34.pyc311720644editdlrm
platform.cpython-34.pyo311720644editdlrm
plistlib.cpython-34.pyc301510644editdlrm
plistlib.cpython-34.pyo300680644editdlrm
poplib.cpython-34.pyc137540644editdlrm
poplib.cpython-34.pyo137540644editdlrm
posixpath.cpython-34.pyc98090644editdlrm
posixpath.cpython-34.pyo98090644editdlrm
pprint.cpython-34.pyc114600644editdlrm
pprint.cpython-34.pyo112950644editdlrm
profile.cpython-34.pyc151510644editdlrm
profile.cpython-34.pyo148980644editdlrm
pstats.cpython-34.pyc236750644editdlrm
pstats.cpython-34.pyo236750644editdlrm
pty.cpython-34.pyc42250644editdlrm
pty.cpython-34.pyo42250644editdlrm
pyclbr.cpython-34.pyc91920644editdlrm
pyclbr.cpython-34.pyo91920644editdlrm
pydoc.cpython-34.pyc909150644editdlrm
pydoc.cpython-34.pyo908540644editdlrm
py_compile.cpython-34.pyc68570644editdlrm
py_compile.cpython-34.pyo68570644editdlrm
queue.cpython-34.pyc92620644editdlrm
queue.cpython-34.pyo92620644editdlrm
quopri.cpython-34.pyc64460644editdlrm
quopri.cpython-34.pyo62360644editdlrm
random.cpython-34.pyc190590644editdlrm
random.cpython-34.pyo190590644editdlrm
re.cpython-34.pyc145500644editdlrm
re.cpython-34.pyo145500644editdlrm
reprlib.cpython-34.pyc58720644editdlrm
reprlib.cpython-34.pyo58720644editdlrm
rlcompleter.cpython-34.pyc56950644editdlrm
rlcompleter.cpython-34.pyo56950644editdlrm
runpy.cpython-34.pyc77530644editdlrm
runpy.cpython-34.pyo77530644editdlrm
sched.cpython-34.pyc65730644editdlrm
sched.cpython-34.pyo65730644editdlrm
selectors.cpython-34.pyc167440644editdlrm
selectors.cpython-34.pyo167440644editdlrm
shelve.cpython-34.pyc99550644editdlrm
shelve.cpython-34.pyo99550644editdlrm
shlex.cpython-34.pyc75180644editdlrm
shlex.cpython-34.pyo75180644editdlrm
shutil.cpython-34.pyc330150644editdlrm
shutil.cpython-34.pyo330150644editdlrm
site.cpython-34.pyc179710644editdlrm
site.cpython-34.pyo179710644editdlrm
smtpd.cpython-34.pyc256690644editdlrm
smtpd.cpython-34.pyo256690644editdlrm
smtplib.cpython-34.pyc331290644editdlrm
smtplib.cpython-34.pyo330550644editdlrm
sndhdr.cpython-34.pyc67690644editdlrm
sndhdr.cpython-34.pyo67690644editdlrm
socket.cpython-34.pyc181110644editdlrm
socket.cpython-34.pyo180610644editdlrm
socketserver.cpython-34.pyc232550644editdlrm
socketserver.cpython-34.pyo232550644editdlrm
sre_compile.cpython-34.pyc119350644editdlrm
sre_compile.cpython-34.pyo117780644editdlrm
sre_constants.cpython-34.pyc55810644editdlrm
sre_constants.cpython-34.pyo55810644editdlrm
sre_parse.cpython-34.pyc202380644editdlrm
sre_parse.cpython-34.pyo202380644editdlrm
ssl.cpython-34.pyc276080644editdlrm
ssl.cpython-34.pyo276080644editdlrm
stat.cpython-34.pyc35780644editdlrm
stat.cpython-34.pyo35780644editdlrm
statistics.cpython-34.pyc171580644editdlrm
statistics.cpython-34.pyo168560644editdlrm
string.cpython-34.pyc83760644editdlrm
string.cpython-34.pyo83760644editdlrm
stringprep.cpython-34.pyc136360644editdlrm
stringprep.cpython-34.pyo135730644editdlrm
struct.cpython-34.pyc3470644editdlrm
struct.cpython-34.pyo3470644editdlrm
subprocess.cpython-34.pyc433590644editdlrm
subprocess.cpython-34.pyo432460644editdlrm
sunau.cpython-34.pyc183090644editdlrm
sunau.cpython-34.pyo183090644editdlrm
symbol.cpython-34.pyc26620644editdlrm
symbol.cpython-34.pyo26620644editdlrm
symtable.cpython-34.pyc113050644editdlrm
symtable.cpython-34.pyo111830644editdlrm
sysconfig.cpython-34.pyc172870644editdlrm
sysconfig.cpython-34.pyo172870644editdlrm
tabnanny.cpython-34.pyc77490644editdlrm
tabnanny.cpython-34.pyo77490644editdlrm
tarfile.cpython-34.pyc680400644editdlrm
tarfile.cpython-34.pyo680400644editdlrm
telnetlib.cpython-34.pyc193940644editdlrm
telnetlib.cpython-34.pyo193940644editdlrm
tempfile.cpython-34.pyc215760644editdlrm
tempfile.cpython-34.pyo215760644editdlrm
textwrap.cpython-34.pyc138000644editdlrm
textwrap.cpython-34.pyo137140644editdlrm
this.cpython-34.pyc13160644editdlrm
this.cpython-34.pyo13160644editdlrm
threading.cpython-34.pyc389650644editdlrm
threading.cpython-34.pyo382520644editdlrm
timeit.cpython-34.pyc110620644editdlrm
timeit.cpython-34.pyo110620644editdlrm
token.cpython-34.pyc36150644editdlrm
token.cpython-34.pyo36150644editdlrm
tokenize.cpython-34.pyc199510644editdlrm
tokenize.cpython-34.pyo199010644editdlrm
trace.cpython-34.pyc241840644editdlrm
trace.cpython-34.pyo241270644editdlrm
traceback.cpython-34.pyc110910644editdlrm
traceback.cpython-34.pyo110910644editdlrm
tracemalloc.cpython-34.pyc171300644editdlrm
tracemalloc.cpython-34.pyo171300644editdlrm
tty.cpython-34.pyc11460644editdlrm
tty.cpython-34.pyo11460644editdlrm
types.cpython-34.pyc55600644editdlrm
types.cpython-34.pyo55600644editdlrm
uu.cpython-34.pyc40210644editdlrm
uu.cpython-34.pyo40210644editdlrm
uuid.cpython-34.pyc218640644editdlrm
uuid.cpython-34.pyo218020644editdlrm
warnings.cpython-34.pyc122680644editdlrm
warnings.cpython-34.pyo115360644editdlrm
wave.cpython-34.pyc191350644editdlrm
wave.cpython-34.pyo190740644editdlrm
weakref.cpython-34.pyc203450644editdlrm
weakref.cpython-34.pyo203080644editdlrm
webbrowser.cpython-34.pyc171320644editdlrm
webbrowser.cpython-34.pyo170930644editdlrm
xdrlib.cpython-34.pyc90020644editdlrm
xdrlib.cpython-34.pyo90020644editdlrm
zipfile.cpython-34.pyc458200644editdlrm
zipfile.cpython-34.pyo457710644editdlrm
_bootlocale.cpython-34.pyc10470644editdlrm
_bootlocale.cpython-34.pyo10160644editdlrm
_collections_abc.cpython-34.pyc239490644editdlrm
_collections_abc.cpython-34.pyo239490644editdlrm
_compat_pickle.cpython-34.pyc75010644editdlrm
_compat_pickle.cpython-34.pyo74270644editdlrm
_dummy_thread.cpython-34.pyc48250644editdlrm
_dummy_thread.cpython-34.pyo48250644editdlrm
_markupbase.cpython-34.pyc89320644editdlrm
_markupbase.cpython-34.pyo87450644editdlrm
_osx_support.cpython-34.pyc106300644editdlrm
_osx_support.cpython-34.pyo106300644editdlrm
_pyio.cpython-34.pyc649330644editdlrm
_pyio.cpython-34.pyo649070644editdlrm
_sitebuiltins.cpython-34.pyc36770644editdlrm
_sitebuiltins.cpython-34.pyo36770644editdlrm
_strptime.cpython-34.pyc157790644editdlrm
_strptime.cpython-34.pyo157790644editdlrm
_sysconfigdata.cpython-34.pyc227000644editdlrm
_sysconfigdata.cpython-34.pyo227000644editdlrm
_threading_local.cpython-34.pyc69460644editdlrm
_threading_local.cpython-34.pyo69460644editdlrm
_weakrefset.cpython-34.pyc84650644editdlrm
_weakrefset.cpython-34.pyo84650644editdlrm
__future__.cpython-34.pyc41680644editdlrm
__future__.cpython-34.pyo41680644editdlrm
__phello__.foo.cpython-34.pyc1340644editdlrm
__phello__.foo.cpython-34.pyo1340644editdlrm
Edit: /opt/alt/python34/lib64/python3.4/__pycache__/zipfile.cpython-34.pyo (45771B)
f $@sdZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z yddl Z e j Z Wn!ek rdZ e j Z YnXyddlZWnek rdZYnXyddlZWnek rdZYnXddddddd d d d d dg ZGdddeZGdddeZeZZdd>dZdd>dZdd>dZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$e j%e#Z&dZ'dZ(dZ)dZ*dZ+d Z,d!Z-d"Z.dZ/d#Z0d$Z1d%Z2e j%e1Z3dZ4dZ5dZ6dZ7dZ8d Z9d!Z:d"Z;dZ<d#Z=d&Z>d'Z?dZ@d(ZAdZBd)ZCdZDd*ZEd+ZFd,ZGd-ZHe j%eGZIdZJdZKdZLdZMdZNd ZOd!ZPd"ZQdZRd#ZSd&ZTd'ZUd.ZVd/ZWe j%eVZXd0ZYd1ZZe j%eYZ[dZ\dZ]dZ^dZ_dZ`d Zad!Zbd"ZcdZdd#Zed2d3Zfd4d Zgd5d6Zhd7d8ZiGd9d d ejZkGd:d;d;ZlGd<d=d=ZmGd>d?d?Znid@d6dAd6dBd6dBd6dBd6dBd 6dCd!6dDd"6dEd6dFd#6dCd&6dGd6dHd6dId+6dJdK6dLdM6dNdO6ZodPdQZpdRdSZqdTdUZrGdVdWdWejsZtGdXd d ZuGdYd d euZvddZd[Zwexd\krewndS)]zP Read and write ZIP files. XXX references to utf-8 need further investigation. N BadZipFile BadZipfileerror ZIP_STORED ZIP_DEFLATED ZIP_BZIP2ZIP_LZMA is_zipfileZipInfoZipFile PyZipFile LargeZipFilec@seZdZdS)rN)__name__ __module__ __qualname__rr,/opt/alt/python34/lib64/python3.4/zipfile.pyr's c@seZdZdZdS)r zu Raised when writing a zipfile, the zipfile requires ZIP64 extensions and those extensions are disabled. N)rrr__doc__rrrrr +s  -.?s<4s4H2LHsPK z<4s4B4HL2L5H2LsPK z <4s2B4HL2L2HsPKz<4sLQLsPKz <4sQ2H2L4QsPKc Cs-yt|rdSWntk r(YnXdS)NTF) _EndRecDataOSError)fprrr_check_zipfiles   r.cCshd}yIt|dr*td|}n$t|d}t|}WdQXWntk rcYnX|S)zQuickly see if a file is a ZIP file by checking the magic number. The filename argument may be a file or file-like object too. Freadr-rbN)hasattrr.openr,)filenameresultr-rrrr s cCsry|j|tdWntk r0|SYnX|jt}t|tkrV|Stjt|\}}}}|tkr|S|dks|dkrt dn|j|tt d|jt }t|t kr|Stjt |\ }}} } } } } }}}|t kr(|S||t <| |t<| |t<| |t<||t<||t<||t<|S)zM Read the ZIP64 end-of-archive records and use that to update endrec rrrz3zipfiles that span multiple disks are not supported)seeksizeEndCentDir64Locatorr,r/lenstructunpackstructEndArchive64LocatorstringEndArchive64LocatorrsizeEndCentDir64structEndArchive64stringEndArchive64_ECD_SIGNATURE_ECD_DISK_NUMBER_ECD_DISK_START_ECD_ENTRIES_THIS_DISK_ECD_ENTRIES_TOTAL _ECD_SIZE _ECD_OFFSET)fpinoffsetendrecdataZsigZdisknoZreloffZdisksZszcreate_versionZ read_versionZdisk_numZdisk_dirZdircountZ dircount2ZdirsizeZ diroffsetrrr _EndRecData64s6   0        rKc Cs|jdd|j}y|jt dWntk rIdSYnX|j}t|tkr|ddtkr|d ddkrtjt |}t |}|j d|j |tt |t |St |d td}|j|d|j}|jt}|dkr|||t}t|tkrYdSt tjt |}|t}||t|t|}|j ||j ||t |||||SdS) zReturn data from the "End of Central Directory" record, or None. The data is a list of the nine items in the ZIP "End of central dir" record followed by a tenth item, the file seek offset of this record.rrNr srri)r5tellsizeEndCentDirr,r/r7stringEndArchiver8r9structEndArchivelistappendrKmaxrfind_ECD_COMMENT_SIZE) rFZfilesizerIrHZmaxCommentStartstartZrecDataZ commentSizecommentrrrr+s>          r+c@sUeZdZdZd"Zdd#ddZdddZddZd d!ZdS)$r z>Class with attributes describing each file in the ZIP archive. orig_filenamer3 date_time compress_typerXextra create_systemrJextract_versionreserved flag_bitsvolume internal_attr external_attr header_offsetCRC compress_size file_size _raw_timeZNoNamerrcCs&||_|jtd}|dkr=|d|}ntjdkrstj|krs|jtjd}n||_||_|ddkrtdnt |_ d|_ d|_ t jdkrd|_n d|_t|_t|_d|_d|_d|_d|_d|_dS)Nr/iz+ZIP does not support timestamps before 1980rLwin32r)rYfindchrossepreplacer3rZ ValueErrorrr[rXr\sysplatformr]DEFAULT_VERSIONrJr^r_r`rarbrc)selfr3rZZ null_byterrr__init__<s.               zZipInfo.__init__NcCs|j}|ddd>|dd>B|dB}|dd>|d d>B|ddB}|jd @rsd}}}n|j}|j}|j}|j}d} |d kr|tkp|tk}n|rd } |tj| dtj | d ||}n|tks|tkrA|s,t d nd}d}t } n|j t krbtt| } n!|j tkrtt| } nt| |j|_t| |j|_|j\} } tjtt|j|j| |j |||||t| t| } | | |S)z'Return the per-file header as a string.rir$rr!rrr&r rNz[^\r\n]+)|(?P\n|\r\n?)NFcCs||_||_||_|j|_|j|_|j|_t |j|_ d|_ d|_ d|_ d|k|_d|_|jdk r|jd8_n||_|j|_t|dr|j|_tdd@|_n d|_dS)NFrLrUrrel)_fileobj _decrypter_close_fileobjr[_compress_typerf_compress_leftrg_leftr _decompressor_eof _readbuffer_offset _universalnewlinesmoder3namer1re _expected_crccrc32 _running_crc)ruZfileobjrzipinfoZ decrypter close_fileobjrrrrvs(             zZipExtFile.__init__cCs|j rd|dkrd|jjd|jd}|dkrd|j|j|}||_|Sn|jstjj||Sd}x|dkst||kr|jd}|dkr|S|j j |}|j d}|dk rM|j dkrg|_ n||j kr0|j j |n|jt|7_|dS|j d}|dkr|d|t|}n|jt|7_||7}qW|S) zrRead and return a line from the stream. If limit is specified, at most limit bytes will be read. rs rrLrnewlineNchunk)rrrlrioBufferedIOBasereadliner7peekPATTERNsearchgrouprrS)rulimitrlineZ readaheadmatchrrrrrrs8   !     zZipExtFile.readlinecCs|t|j|jkr|j|}t||jkri||j|jd|_d|_q|jt|8_n|j|j|jdS)z6Returns buffered bytes without advancing the position.Nri)r7rrr/)runrrrrrs zZipExtFile.peekcCsdS)NTr)rurrrreadableszZipExtFile.readablecCsp|dks|dkrj|j|jd}d|_d|_x#|jse||j|j7}qCW|S||j}|t|jkr|j|j|}||_|S|t|j}|j|jd}d|_d|_x|dkrk|j rk|j|}|t|krN||_||_||d|7}Pn||7}|t|8}qW|S)zRead and return up to n bytes. If the argument is omitted, None, or negative, data is read and returned until EOF is reached.. NrrL)rrr_read1MAX_Nr7)rurbufendrIrrrr/s4          zZipExtFile.readcCsa|jdkrdSt||jd@|_|jr]|j|jkr]td|jndS)NlzBad CRC-32 for file %r)rrrrrr)runewdatarrr _update_crcs zZipExtFile._update_crccCs||dks|dkrz|j|jd}d|_d|_x3|jsu|j|j}|rC||7}PqCqCW|S||j}|t|jkr|j|j|}||_|S|t|j}|j|jd}d|_d|_|dkrxxo|jst|j|}|t|kr]||_||_||d|7}Pn|r ||7}Pq q Wn|S)z7Read up to n bytes with at most one read() system call.NrrL)rrrrrr7)rurrrIrrrrread1s>              zZipExtFile.read1cCs|js|dkrdS|jtkri|jj}|t|krx||j|t|7}qxn|j|}|jtkr|jdk|_n|jtkrt ||j }|jj ||}|jj p|jdko|jj |_|jrO||jj 7}qOn0|jj |}|jj pI|jdk|_|d|j}|jt|8_|jdkrd|_n|j||S)NrrLT)rrrrZunconsumed_tailr7_read2rrrT MIN_READ_SIZErrrrr)rurrIrrrr4s2 #    zZipExtFile._read1cCs|jdkrdSt||j}t||j}|jj|}|jt|8_|smtn|jdk rt t |j|}n|S)NrrL) rrTrminrr/r7EOFErrorrbytesmap)rurrIrrrrXs zZipExtFile._read2c s2z|jr|jjnWdtjXdS)N)rrclosesuper)ru) __class__rrrhs zZipExtFile.closei@r)rrrrrrrecompilerrvrrrr/rrrrrrr)rrrss  2 ! % $ rc@sxeZdZdZdZdZdedddZddZd d Z d d Z d dZ ddZ dddZ ddZddZddZeddZejddZdddZddddZddd d!Zdddd"d#Zed$d%Zd&d'Zd(d)Zddd*d+Zdd,d-Zd.d/Zd0d1ZdS)2r a Class with methods to open, read, write, close, list zip files. z = ZipFile(file, mode="r", compression=ZIP_STORED, allowZip64=True) file: Either the path to the file, or a file-like object. If it is a path, the file will be opened and closed by ZipFile. mode: The mode can be either read "r", write "w" or append "a". compression: ZIP_STORED (no compression), ZIP_DEFLATED (requires zlib), ZIP_BZIP2 (requires bz2) or ZIP_LZMA (requires lzma). allowZip64: if True ZipFile will create files with ZIP64 extensions when needed, otherwise it will raise an exception when this would be necessary. NrTcCs6|dkrtdnt|||_d|_d|_i|_g|_||_|jddd|_ }d |_ d |_ t |t r0d|_||_id d6d d6d d6}ytj||||_WqWtk r,|dkr%d}}tj||||_nYqWXn'd|_||_t|dd |_y|dkrs|jn|dkrd|_np|dkry$|j|jj|jdWqtk r|jjddd|_YqXn tdWn3|j}d |_|js*|jnYnXd S)z>Open the ZIP file with mode read "r", write "w" or append "a".rwaz(ZipFile() requires mode "r", "w", or "a"FrbNrLr0wbzr+brrTrzMode must be "r", "w" or "a")rrr)rr _allowZip64 _didModifydebug NameToInfofilelistrrprr_comment isinstancestr _filePassedr3rr2r-r,getattr_RealGetContentsr5 start_dirrr)rufilerr allowZip64keyZmodeDictr-rrrrvsZ                             zZipFile.__init__cCs|S)Nr)rurrr __enter__szZipFile.__enter__cCs|jdS)N)r)rutypevalue tracebackrrr__exit__szZipFile.__exit__cCs|j}yt|}Wntk r9tdYnX|sOtdn|jdkrkt|n|t}|t}|t|_ |t ||}|t t kr|t t8}n|jdkr||}td|||n|||_|j|jd|j|}tj|}d}xx||kr|jt} t| tkrqtdntjt| } | ttkrtdn|jdkrt| n|j| t} | d} | d @r| jd } n| jd } t| } |j| t| _|j| t | _!| t"| _#| dd \ | _$| _%| _&| _'| _(| _)} }| _*| _+| _,| j&t-krt.d | j&dn| dd\| _/| _0| _1| | _2|d?d|d?d@|d@| d?| d?d@| d@df| _3| j4| j#|| _#|j5j6| | |j7| j8<|t| t| t| t }|jdkr5td|q5q5WdS)z/Read in the table of contents for the ZIP file.zFile is not a zip filerrzgiven, inferred, offsetrzTruncated central directoryz&Bad magic number for central directoryr!izutf-8cp437rzzip file version %.1fr%r(r*r$irr&rtotalN)9r-r+r,rrprintrDrE _ECD_COMMENTr  _ECD_LOCATIONr?r>r<r6rr5r/rBytesIOsizeCentralDirr7r8r9structCentralDir _CD_SIGNATUREstringCentralDir_CD_FILENAME_LENGTHdecoder _CD_EXTRA_FIELD_LENGTHr\_CD_COMMENT_LENGTHrX_CD_LOCAL_HEADER_OFFSETrdrJr]r^r_r`r[rerfrgMAX_EXTRACT_VERSIONrrarbrcrhrZrrrSrr3)rur-rHZsize_cdZ offset_cdconcatZinferredrIrcentdirr3flagsxtdrrrrsp             L" & "zZipFile._RealGetContentscCsdd|jDS)z+Return a list of file names in the archive.cSsg|]}|jqSr)r3).0rIrrr s z$ZipFile.namelist..)r)rurrrnamelistszZipFile.namelistcCs|jS)zJReturn a list of class ZipInfo instances for files in the archive.)r)rurrrinfolistszZipFile.infolistcCsftdd d|xK|jD]@}d|jdd}td |j||jfd|qWdS) z+Print a table of contents for the zip file.z%-46s %19s %12s File Name Modified Sizerz%d-%02d-%02d %02d:%02d:%02dNr"z %-46s %s %12d)r2r3r4)rrrZr3rg)rurzinfoZdaterrrprintdir!s  zZipFile.printdircCsrd}xe|jD]Z}y8|j|jd}x|j|rFq4WWdQXWqtk ri|jSYqXqWdS)z%Read all the files and check the CRC.rrrNi)rr2r3r/r)ruZ chunk_sizer5frrrtestzip*s zZipFile.testzipcCs5|jj|}|dkr1td|n|S)z,Return the instance of ZipInfo given 'name'.Nz(There is no item named %r in the archive)rrKeyError)rurinforrrgetinfo7s  zZipFile.getinfocCsN|r/t|t r/tdt|n|rA||_n d|_dS)z)Set default password for encrypted files.zpwd: expected bytes, got %sN)r r TypeErrorrr)rurrrr setpassword@s  zZipFile.setpasswordcCs|jS)z.The comment text associated with the ZIP file.)r )rurrrrXIszZipFile.commentcCst|ts(tdt|nt|tkrpddl}|jdtdd|dt}n||_d|_ dS)Nzcomment: expected bytes, got %srz3Archive comment is too long; truncating to %d bytes stacklevelrT) r rr<rr7ZIP_MAX_COMMENTwarningswarnr r)rurXr@rrrrXNs   cCs,|j|d|}|jSWdQXdS)z)Return file bytes (as a string) for name.rN)r2r/)rurrr-rrrr/[sz ZipFile.readc Cs5|dkrtdnd|krIddl}|jdtdn|rxt|t rxtd t|n|jstd n|j r|j}nt j |j d }ySt|t r|}n|j|}|j|jd|jt}t|tkr'td ntjt|}|ttkrXtd n|j|t}|tr|j|tn|jd@rtdn|jd@rtdn|jd@r|jd} n|jd} | |jkrtd|j|fn|jd@} d} | r|sE|j }n|s^td|nt!|} |jd} t"t#| | dd} |jd@r|j$d?d@}n|j%d?d@}| d|krtd|qnt&|||| d|j SWn!|j s)|j'nYnXdS) z#Return file-like object for 'name'.rrrUz&open() requires mode "r", "U", or "rU"rNz'U' mode is deprecatedrzpwd: expected bytes, got %sz3Attempt to read ZIP archive that was already closedr0zTruncated file headerz Bad magic number for file header z$compressed patched data (flag bit 5)@zstrong encryption (flag bit 6)izutf-8rz/File name in directory %r and header %r differ.rz6File %s is encrypted, password required for extractionrrrrr&zBad password for filer)rrrB)(rr@rADeprecationWarningr rr<rr-r rr2r3r r;r5rdr/sizeFileHeaderr7rr8r9r~ _FH_SIGNATUREr_FH_FILENAME_LENGTH_FH_EXTRA_FIELD_LENGTHr`rr#rYrrrRrrhrerr)rurrrr@Zzef_filer5ZfheaderfnameZ fname_strZ is_encryptedZzdrhZ check_byterrrr2`sz                     z ZipFile.opencCsOt|ts!|j|}n|dkr<tj}n|j|||S)a#Extract a member from the archive to the current working directory, using its full name. Its file information is extracted as accurately as possible. `member' may be a filename or a ZipInfo object. You can specify a different directory using `path'. N)r r r;rngetcwd_extract_member)rumemberpathrrrrextracts  zZipFile.extractcCsC|dkr|j}nx!|D]}|j|||q"WdS)zExtract all members from the archive to the current working directory. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by namelist(). N)r0rP)rurOZmembersrrrrr extractalls  zZipFile.extractallcCs|j}|s=d}tj|dt|}||_n|j|}dd|j|D}|jdd|D}|S)z;Replace bad characters and remove trailing dots from parts.z:<>|"?*_css|]}|jdVqdS).N)rstrip)r.r+rrr sz1ZipFile._sanitize_windows_name..css|]}|r|VqdS)Nr)r.r+rrrrUs)!_windows_illegal_name_trans_tabler  maketransr7 translatesplitjoin)clsarcnamepathseprZillegalrrr_sanitize_windows_names  zZipFile._sanitize_windows_namecs|jjdtjj}tjjrH|jtjjtjj}ntjj|d}dtjjtjjftjjj fdd|j tjjD}tjjdkr|j |tjj}ntjj ||}tjj |}tjj |}|r?tjj| r?tj|n|jd dkrxtjj|sttj|n|S|j|d|/}t|d}tj||Wd QXWd QX|S) zbExtract the ZipInfo object 'member' to a physical file on the path targetpath. rjrrc3s!|]}|kr|VqdS)Nr)r.r+)invalid_path_partsrrrUsz*ZipFile._extract_member..\rrNr)r3rprnrOroaltsep splitdrivecurdirpardirrZrYr^normpathdirnameexistsmakedirsisdirmkdirr2shutilZ copyfileobj)rurNZ targetpathrr\Z upperdirssourcetargetr)r_rrMs* !7zZipFile._extract_membercCs|j|jkr;ddl}|jd|jddn|jdkrYtdn|jsqtd nt|j|j sd}t |j t krd }n0|j tkrd }n|jtkrd }n|rt|d qndS)z6Check for errors before writing a file to the archive.rNzDuplicate name: %rr>rrrz write() requires mode "w" or "a"z4Attempt to write ZIP archive that was already closedz Files countZFilesizez Zipfile sizez would require ZIP64 extensions)rr)r3rr@rArrr-rr[rr7rZIP_FILECOUNT_LIMITrgrwrdr )rur5r@requires_zip64rrr _writechecks(        zZipFile._writecheckc Cs |jstdntj|}tj|j}tj|j}|dd}|dkrp|}ntj j tj j |d}x0|dtj tj fkr|dd}qW|r|d7}nt||}|dd@d>|_|rt|_n$|dkr)|j|_n ||_|j|_d|_|jj|_|jtkrz|jd O_n|j|d |_|rd|_d|_d|_|jdO_|jj|||j|j <|jj!|j"d dSt#|j} t$|d } d|_} d|_} |j%oQ|jd t&k} |jj!|j"| d}xx| j'd}|sPn|t(|}t)|| d@} | r| j*|}| t(|} n|jj!|qvWWdQX| r2| j+}| t(|} |jj!|| |_n ||_| |_||_| r|j%r|t&krxtdn| t&krtdqn|jj}|jj,|jd|jj!|j"| |jj,|d|jj|||j|j |dd>B|d B}|d d >|d d>B|dd B}g}|jtks|jtkr|j |j|j |jd }d }n|j}|j}|j tkr/|j |j d } n |j } |j } d} |rt j ddt|ddt||| } t} n|jtkrtt| } n!|jtkrtt| } nt| |j} t| |j} y|j\}}t j tt| |j| |j||j|||j||t|t| t|jd|j|j | }Wnt!k rt"tt| |j| |j|j#|j|||j||t|j$t| t|jd|j|j | fdt%j&YnX|jj'||jj'||jj'| |jj'|jqGW|jj}t|j}||}|}d}|t(krd}n*|tkrd}n|tkrd}n|r}|j)st*|dnt j t+t,ddddd|||| }|jj'|t j t-t.d|d}|jj'|t/|d}t/|d }t/|d }nt j t0t1dd||||t|j2 }|jj'||jj'|j2|jj3nWd|j}d|_|j4s |j5nXdS)zJClose the file, and for mode "w" and "a" write the ending records.Nrrrir$rr!rrr&r lzr:r;rrQrPr rr r)ruZpos1r5rrrr\rgrfrdZ extra_datarr^rJr3r`r)Zpos2Z centDirCountZ centDirSizeZ centDirOffsetroZ zip64endrecZ zip64locrecrHr-rrrrs &&             !               z ZipFile.close) rrrrr-rVrrvrrrr0r1r6r8r;r=propertyrXsetterr/r2rPrQ classmethodr^rMrprxr|r}rrrrrr ps4 A   N    `  ' [8 c@sLeZdZdZdedd ddZddd d Zd d ZdS)r zDClass to create ZIP archives with Python library files and packages.rTrc Cs/tj||d|d|d|||_dS)Nrrr)r rv _optimize)rurrrroptimizerrrrv4szPyZipFile.__init__rNcCs|rU|| rU|jrQtjj|r4dnd}td||fndStjj|\}}tjj|rXtjj|d}tjj|rh|rd||f}n|}|jrtd|d|n|j|d d|\}} |jrtd | n|j || tj |} | j dx| D]} tjj|| } tjj | \} }tjj| rtjjtjj| dra|j | |d |qaqR|d krR|r||  r|jrRtd| qRqRn|j| d d|\}} |jrNtd | n|j || qRqRWq|jrtd|nxDtj |D]} tjj|| } tjj | \} }|d kr|r||  r|jrtd| qqn|j| d d|\}} |jr>td | n|j || qqWnp|ddd kr}tdn|j|d d|\}} |jrtd| n|j || dS)aAdd all files from "pathname" to the ZIP archive. If pathname is a package directory, search the directory and all package subdirectories recursively for all *.py and enter the modules into the archive. If pathname is a plain directory, listdir *.py and enter all modules. Else, pathname must be a Python *.py file and the module will be put into the archive. Added modules are always module.pyo or module.pyc. This method will compile the module.py into module.pyc if necessary. If filterfunc(pathname) is given, it is called with every argument. When it is False, the file or directory is skipped. rOrz%s "%s" skipped by filterfuncNz __init__.pyz%s/%szAdding package inasrrZAdding filterfuncz.pyzfile "%s" skipped by filterfunczAdding files from directoryz.Files added with writepy() must end with ".py"z Adding filerrrr)rrnrOrirrYrZisfile _get_codenamerxlistdirremovesplitextwritepyr)rupathnamebasenamerZlabeldirrZinitnamerJr\Zdirlistr3rOrootZextrrrr:sv  "   !         " zPyZipFile.writepyc szd fdd}|d}|d}|d}tjj|d}tjj|d}jd krtjj|rtj|jtj|jkr|} } qAtjj|rtj|jtj|jkr|} } qAtjj|r7tj|jtj|jkr7|} |} qAtjj|r|tj|jtj|jkr||} |} qA||rt r|n|} t r|n|} qA|} } njd kr|} |} n |} |} tjj| otj| jtj|jksA||d jsA|} } qAntjj | d} |rpd || f} n| | fS)aReturn (filename, archivename) for the path. Given a module name path, return the correct file path and archive name, compiling if necessary. For example, given /python/lib/string, return (/python/lib/string.pyc, string). rcsddl}jr%td|ny|j|ddd|Wn9|jk r}}zt|jdSWYdd}~XnXdS)NrZ CompilingdoraiseTrF) py_compilerrrPyCompileErrormsg)rrrerr)rurr_compiles   z)PyZipFile._get_codename.._compilez.pyz.pycz.pyoTFrrz%s/%srr) importlibutilcache_from_sourcerrnrOrrqrv __debug__rY) rurrrZfile_pyZfile_pycZfile_pyoZ pycache_pycZ pycache_pyor\rJZ archivenamer)rurrsL   $ $ $ $    $zPyZipFile._get_codenamer)rrrrrrvrrrrrrr 1s Qc sddl}|jd}|dkr=tjdd}n| sT|ddkrnt|tjdn|ddkrt|dkrt|tjdnt|dd }|jWdQXn|ddkr`t|dkrt|tjdnt|dd }|j }WdQX|rStd j |ntd na|ddkrt|d krt|tjdnt|dd }|j |dWdQXn|ddkrt|d krt|tjdnfd dt|dd}x|ddD]s}t j j|}|st j jt j j|}n|dt jt jfkrd}n|||qAWWdQXndS)NraE Usage: zipfile.py -l zipfile.zip # Show listing of a zipfile zipfile.py -t zipfile.zip # Test if a zipfile is valid zipfile.py -e zipfile.zip target # Extract zipfile into target dir zipfile.py -c zipfile.zip src ... # Create zipfile from sources r-l-c-e-trrz.The following enclosed file is corrupted: {!r}z Done testingrcstjj|r(|j||tnvtjj|r|rS|j||nxHtj|D]4}|tjj||tjj||qcWndS)N)rnrOrrxrrirrZ)zfrOzippathZnm)addToZiprrrszmain..addToZiprr)rrrr)textwrapdedentrrargvrexitr7r r6r8formatrQrnrOrrfrcrd)argsrZUSAGErZbadfilerOrr)rrmainsT          ! r__main__)yrrrnrimportlib.utilrrrrtrqrkr8Zbinasciirr ImportErrorrr__all__ Exceptionrr rrrwrnr?rrrrrtrzr{r|r'rQrPryrOr?r@rArBrCrDrErVrrrr!rr Z_CD_CREATE_VERSIONZ_CD_CREATE_SYSTEMZ_CD_EXTRACT_VERSIONZ_CD_EXTRACT_SYSTEMZ _CD_FLAG_BITSZ_CD_COMPRESS_TYPEZ_CD_TIMEZ_CD_DATEZ_CD_CRCZ_CD_COMPRESSED_SIZEZ_CD_UNCOMPRESSED_SIZEr"r$r%Z_CD_DISK_NUMBER_STARTZ_CD_INTERNAL_FILE_ATTRIBUTESZ_CD_EXTERNAL_FILE_ATTRIBUTESr&r~rrFrGZ_FH_EXTRACT_VERSIONZ_FH_EXTRACT_SYSTEMZ_FH_GENERAL_PURPOSE_FLAG_BITSZ_FH_COMPRESSION_METHODZ_FH_LAST_MOD_TIMEZ_FH_LAST_MOD_DATEZ_FH_CRCZ_FH_COMPRESSED_SIZEZ_FH_UNCOMPRESSED_SIZErHrIr:r;r6r=r>r<Z_CD64_SIGNATUREZ_CD64_DIRECTORY_RECSIZEZ_CD64_CREATE_VERSIONZ_CD64_EXTRACT_VERSIONZ_CD64_DISK_NUMBERZ_CD64_DISK_NUMBER_STARTZ_CD64_NUMBER_ENTRIES_THIS_DISKZ_CD64_NUMBER_ENTRIES_TOTALZ_CD64_DIRECTORY_SIZEZ_CD64_OFFSET_START_CENTDIRr.r rKr+objectr rrrrrrrrrr r rrrrrrs"                        + ==   B