Ticket #6851 (closed defect: fixed)
Zip Archives created with Trac/python2.5 have bad file attributes
| Reported by: | hvr | Owned by: | cboos |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.11 |
| Component: | version control/changeset view | Version: | |
| Severity: | normal | Keywords: | python25 zip |
| Cc: |
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
Change History
comment:1 Changed 3 years ago by cboos
- Keywords python25 zip added
- Owner changed from jonas to cboos
- Component changed from general to changeset view
- Milestone set to 0.11
comment:2 Changed 3 years ago by cboos
- Status changed from new to closed
- Resolution set to fixed
Fixed in [6558], thanks for the report and the hint given for fixing it.
comment:3 Changed 3 years ago by hvr
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 Changed 3 years ago by cboos
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.