[issue9172] zipfile.extractall always raises an OSError after successfully unzipping all files

2010-07-25 Thread Teemu Rytkönen

Teemu Rytkönen  added the comment:

Hi!
I encountered the same problem and I debugged it a bit..
I think it not doing the entire unzipping again, but the problem is that the 
winzip packaged zip actually contains all file and directory entries and it 
fails trying to create already existing directory (because the dir has been 
created for the files that are in it).

I tried a quick and dirty fix for the zipfile _extract_member method, which 
basically should fix the problem! 

So here I create the directory only if it is not already existing, to get those 
empty directories created inside the zip.

zipfile:
959:if member.filename[-1] == '/':
   if not os.path.isdir(targetpath):
960:os.mkdir(targetpath)

--
nosy: +terytkon
versions: +Python 2.6

___
Python tracker 
<http://bugs.python.org/issue9172>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9172] zipfile.extractall always raises an OSError after successfully unzipping all files

2010-07-29 Thread Teemu Rytkönen

Teemu Rytkönen  added the comment:

Hi!

I haven't tested this in linux or with python 2.7 so can't say for sure.. 

However I would assume that the main issue is with the zipdate it self (So does 
it have those empty directories, which at least winzip creates) and then about 
how does the os.mkdir act with when trying to create already existing folder.

Did you try it with the example_1.zip, which has those folders described in the 
zip centralrecord??

Should I also try it out with linux?

-Teemu

--

___
Python tracker 
<http://bugs.python.org/issue9172>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com