Working under windows with python 2.x, files on local drives (not UNC).
It seems ziplib stores filenames inside the zip archive stripping the drive letter and converting the path separator:
C:\msala\test.txt --> msala/test.txt
Questions:
is this behaviour compliant with the specifications of the zip file format, or just a caveat of ziplib ?
how can I check if a given filename is in the archive ?
I prefer to avoid this ugly hack:
if sys.platform == "win32" :
if filename[1:3] == ":\\" :
filename = filename[3:]
filename = filename.replace(os.sep, '/')
if filename in zfh.namelist() :
IMHO it is very un-pythonic (batteries included ?!) to have to manage this...