Hi,
On 25 Mrz., 07:54, Noah Kantrowitz n...@coderanger.net wrote:
We have yet to be able to track down the cause of this. There is a
metadata field in the zip file header that we are setting for all
files, but certain zip programs seem to ignore this and probably use
some other field which we don't set (and so is 0). If you want to do
an unzip, set perms, rezip and then try to compare the header data on
both files it would surely help track down what we need to set to make
them work.
Downloaded, modified the permissions rezipped the includemacro, as
an example.
Unfortunately, I have no idea at all about zip file format(s) or how
to output the header.
That said, playing with python zipinfo I suspect the information held
in external_attr is the villain;
it is always 0 in the downloaded archive but has a value in the re-
zipped one - whatever the value
means...
$ python2.4 -i -c 'import zipfile; z_downloaded = zipfile.ZipFile
(includemacro-r5399.zip); z_rezipped = zipfile.ZipFile
(includemacro.zip)'
for name in z_downloaded.namelist():
... print '\n', name
... print *** downloaded, pformat(z_downloaded.getinfo
(name).__dict__)
... print +++ re-zipped, pformat(z_rezipped.getinfo
(name).__dict__)
...
includemacro/0.11/includemacro/__init__.py
*** downloaded {'CRC': 0,
'comment': '',
'compress_size': 2L,
'compress_type': 8,
'create_system': 3,
'create_version': 20,
'date_time': (2007, 1, 9, 7, 15, 14),
'external_attr': 0L,
'extra': '',
'extract_version': 20,
'file_offset': 72L,
'file_size': 0L,
'filename': 'includemacro/0.11/includemacro/__init__.py',
'flag_bits': 0,
'header_offset': 0L,
'internal_attr': 0,
'orig_filename': 'includemacro/0.11/includemacro/__init__.py',
'reserved': 0,
'volume': 0}
+++ re-zipped {'CRC': 0,
'comment': '',
'compress_size': 0L,
'compress_type': 0,
'create_system': 3,
'create_version': 23,
'date_time': (2007, 1, 9, 7, 15, 14),
'external_attr': 2175008768L,
'extra': 'UT\x05\x00\x03\xf22\xa3EUx\x00\x00',
'extract_version': 10,
'file_offset': 308L,
'file_size': 0L,
'filename': 'includemacro/0.11/includemacro/__init__.py',
'flag_bits': 0,
'header_offset': 215L,
'internal_attr': 0,
'orig_filename': 'includemacro/0.11/includemacro/__init__.py',
'reserved': 0,
'volume': 0}
includemacro/0.11/includemacro/macros.py
*** downloaded {'CRC': 1468807806,
'comment': '',
'compress_size': 1478L,
'compress_type': 8,
'create_system': 3,
'create_version': 20,
'date_time': (2008, 5, 6, 7, 52, 52),
'external_attr': 0L,
'extra': '',
'extract_version': 20,
'file_offset': 144L,
'file_size': 4230L,
'filename': 'includemacro/0.11/includemacro/macros.py',
'flag_bits': 0,
'header_offset': 74L,
'internal_attr': 0,
'orig_filename': 'includemacro/0.11/includemacro/macros.py',
'reserved': 0,
'volume': 0}
+++ re-zipped {'CRC': 1468807806,
'comment': '',
'compress_size': 1478L,
'compress_type': 8,
'create_system': 3,
'create_version': 23,
'date_time': (2008, 5, 6, 7, 52, 52),
'external_attr': 2175008768L,
'extra': 'UT\x05\x00\x034\xf2\x1fHUx\x00\x00',
'extract_version': 20,
'file_offset': 399L,
'file_size': 4230L,
'filename': 'includemacro/0.11/includemacro/macros.py',
'flag_bits': 0,
'header_offset': 308L,
'internal_attr': 1,
'orig_filename': 'includemacro/0.11/includemacro/macros.py',
'reserved': 0,
'volume': 0}
includemacro/0.11/setup.py
*** downloaded {'CRC': -555718993,
'comment': '',
'compress_size': 446L,
'compress_type': 8,
'create_system': 3,
'create_version': 20,
'date_time': (2008, 5, 6, 7, 52, 52),
'external_attr': 0L,
'extra': '',
'extract_version': 20,
'file_offset': 1678L,
'file_size': 794L,
'filename': 'includemacro/0.11/setup.py',
'flag_bits': 0,
'header_offset': 1622L,
'internal_attr': 0,
'orig_filename': 'includemacro/0.11/setup.py',
'reserved': 0,
'volume': 0}
+++ re-zipped {'CRC': -555718993,
'comment': '',
'compress_size': 446L,
'compress_type': 8,
'create_system': 3,
'create_version': 23,
'date_time': (2008, 5, 6, 7, 52, 52),
'external_attr': 2175008768L,
'extra': 'UT\x05\x00\x034\xf2\x1fHUx\x00\x00',
'extract_version': 20,
'file_offset': 1954L,
'file_size': 794L,
'filename': 'includemacro/0.11/setup.py',
'flag_bits': 0,
'header_offset': 1877L,
'internal_attr': 1,
'orig_filename': 'includemacro/0.11/setup.py',
'reserved': 0,
'volume': 0}
includemacro/0.11/README
*** downloaded {'CRC': -1243724499,
'comment': '',
'compress_size': 707L,
'compress_type': 8,
'create_system': 3,
'create_version': 20,
'date_time': (2008, 5, 17, 18, 25, 14),
'external_attr': 0L,
'extra': '',
'extract_version': 20,
'file_offset': 2178L,
'file_size': 1304L,
'filename': 'includemacro/0.11/README',
'flag_bits': 0,
'header_offset': 2124L,
'internal_attr': 0,
'orig_filename': 'includemacro/0.11/README',
'reserved': 0,
'volume': 0}
+++ re-zipped {'CRC': -1243724499,
'comment': '',
'compress_size': 707L,
'compress_type': 8,
'create_system': 3,