]> granicus.if.org Git - python/commitdiff
Patch #1412872: zipfile: use correct system type on unixy systems.
authorMartin v. Löwis <martin@v.loewis.de>
Sun, 5 Feb 2006 17:09:41 +0000 (17:09 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sun, 5 Feb 2006 17:09:41 +0000 (17:09 +0000)
Lib/zipfile.py
Misc/NEWS

index 93436cf8b350f3138fbe67f1fbde8a853c16c0ae..037843c86da4c5fb2ba21ced76f11ac3f0c4c7d3 100644 (file)
@@ -1,6 +1,6 @@
 "Read and write ZIP files."
 
-import struct, os, time
+import struct, os, time, sys
 import binascii
 
 try:
@@ -131,7 +131,11 @@ class ZipInfo:
         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
+        if sys.platform == 'win32':
+            self.create_system = 0          # System which created ZIP archive
+        else:
+            # Assume everything else is unix-y
+            self.create_system = 3          # 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
index 1e828d6a44ca2ac31fdb6e53dda42a8f80f9e59b..d998434bea9715fce440d962aa7dc6bf46137cf3 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -358,6 +358,9 @@ Extension Modules
 Library
 -------
 
+- Patch #1412872: zipfile now sets the creator system to 3 (Unix)
+  unless the system is Win32.
+
 - Patch #1349118: urllib now supports user:pass@ style proxy 
   specifications, raises IOErrors when proxies for unsupported protocols
   are defined, and uses the https proxy on https redirections.