zipfile: grabbing whole directories

Dan Thomas-Paquin danpaquin at yahoo.com
Mon Apr 30 16:42:41 EDT 2007


Hi,
The built in zipfile.write doesn't seem to like  taking a directory instead of  a filename.  

for example:
for each in listofdir:
                archive.write(each)

blows up when one of the items listed in listofdir is a subdirectory.

  File "/usr/local/lib/python2.4/zipfile.py", line 405, in write
    fp = open(filename, "rb")

is there a mode or a '-r' style param I am missing?

Thanks in advance,
Dan

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070430/fe26c4c7/attachment.html>


More information about the Python-list mailing list