Edgewall Software

Ticket #6851 (closed defect: fixed)

Opened 11 months ago

Last modified 11 months ago

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

Changed 11 months 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

See also PythonBug:1412872 for more background.

Changed 11 months 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.

Changed 11 months 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?

Changed 11 months 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.

Add/Change #6851 (Zip Archives created with Trac/python2.5 have bad file attributes)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from cboos. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.