--- zipfile.py.orig 2005-06-29 08:49:55.075161712 +0200 +++ zipfile.py 2005-06-29 09:16:50.348602824 +0200 @@ -1,6 +1,6 @@ "Read and write ZIP files." -import struct, os, time +import struct, os, time, sys import binascii try: @@ -131,7 +131,6 @@ self.compress_type = ZIP_STORED # Type of compression for the file self.comment = "" # Comment for each file self.extra = "" # ZIP extra data - self.create_system = 0 # System which created ZIP archive self.create_version = 20 # Version which created ZIP archive self.extract_version = 20 # Version needed to extract archive self.reserved = 0 # Must be zero @@ -139,6 +138,32 @@ self.volume = 0 # Volume number of file header self.internal_attr = 0 # Internal attributes self.external_attr = 0 # External file attributes + +# set System which created ZIP archive ("version made by") accourding +# to ZIP format specification +# +# 0 - MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems) +# 1 - Amiga 2 - OpenVMS +# 3 - Unix 4 - VM/CMS +# 5 - Atari ST 6 - OS/2 H.P.F.S. +# 7 - Macintosh 8 - Z-System +# 9 - CP/M 10 - Windows NTFS +# 11 - MVS (OS/390 - Z/OS) 12 - VSE +# 13 - Acorn Risc 14 - VFAT +# 15 - alternate MVS 16 - BeOS +# 17 - Tandem 18 - OS/400 +# 19 - OS/X (Darwin) 20 thru 255 - unused + + if os.name.startswith("posix"): + if sys.platform.startswith("darwin"): + self.create_system = 19 + else: + self.create_system = 3 + elif os.name.startswith("mac"): + self.create_system = 7 + else: + self.create_system = 0 + # Other attributes are set by class ZipFile: # header_offset Byte offset to the file header # file_offset Byte offset to the start of the file data