Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#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 Christian Boos, 17 years ago

Component: generalchangeset view
Keywords: python25 zip added
Milestone: 0.11
Owner: changed from Jonas Borgström to Christian Boos

See also PythonBug:1412872 for more background.

comment:2 by Christian Boos, 17 years ago

Resolution: fixed
Status: newclosed

Fixed in [6558], thanks for the report and the hint given for fixing it.

comment:3 by hvr, 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 Christian Boos, 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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.