#6851 closed defect (fixed)
Zip Archives created with Trac/python2.5 have bad file attributes
Reported by: | hvr | Owned by: | Christian Boos |
---|---|---|---|
Priority: | normal | Milestone: | 0.11 |
Component: | version control/changeset view | Version: | |
Severity: | normal | Keywords: | python25 zip |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
see also th:ticket:2602
this issue doesn't show up with python 2.4, since there zipfile
defaults to setting the create_system
field to DOS always, but with 2.5 this changed to
-
/usr/lib/python2.
old new 1 self.create_system = 0 # System which created ZIP archive 1 if sys.platform == 'win32': 2 self.create_system = 0 # System which created ZIP archive 3 else: 4 # Assume everything else is unix-y 5 self.create_system = 3 # System which created ZIP archive
basically to fix this, Trac should set ZipInfo external_attr
and/or create_system
fields apropriately, to avoid
Attachments (0)
Change History (4)
comment:1 by , 17 years ago
Component: | general → changeset view |
---|---|
Keywords: | python25 zip added |
Milestone: | → 0.11 |
Owner: | changed from | to
comment:2 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in [6558], thanks for the report and the hint given for fixing it.
comment:3 by , 17 years ago
just wondering, with changeset:6558 for the case of python 2.4, it sets some external_attr
that might not be sensible for the default create_system=0
… shouldn't we explicitly set create_system=3
as well to be on the safe side?
comment:4 by , 17 years ago
I think it's OK like that. If you look at the implementation of ZipFile.write(), you'll see that the upper 16 bits of the external_attr
attribute (dubbed "Unix attributes") are always set, regardless of the value of create_system
attribute.
See also PythonBug:1412872 for more background.