Index: Lib/zipfile.py =================================================================== --- Lib/zipfile.py (revision 42155) +++ Lib/zipfile.py (working copy) @@ -63,6 +63,18 @@ _FH_FILENAME_LENGTH = 10 _FH_EXTRA_FIELD_LENGTH = 11 +# Mapping of os.name values to create_system values +_PKWARE_SYSTEMS=dict( + nt=0, + posix=3, + mac=7, + os2=0, + ce=0, + java=0, + riscos=13, +) + + def is_zipfile(filename): """Quickly see if file is a ZIP file by checking the magic number.""" try: @@ -131,7 +143,11 @@ 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 + try: + self.create_system = _PKWARE_SYSTEMS[os.name] + except KeyError: + self.create_system = 0 # default to MS-DOS + self.create_version = 20 # Version which created ZIP archive self.extract_version = 20 # Version needed to extract archive self.reserved = 0 # Must be zero