]> granicus.if.org Git - python/commitdiff
[Bug #835415] AIX can return modes that are >65536, which causes an OverflowError...
authorAndrew M. Kuchling <amk@amk.ca>
Sat, 10 Jul 2004 15:40:29 +0000 (15:40 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Sat, 10 Jul 2004 15:40:29 +0000 (15:40 +0000)
Lib/zipfile.py

index b1943c17a920e3cbe451ca9e6948c16b17b68ed9..4f200c2537f3d2f24ab04cdc6860f41939af6c47 100644 (file)
@@ -396,7 +396,7 @@ class ZipFile:
             zinfo = ZipInfo(filename, date_time)
         else:
             zinfo = ZipInfo(arcname, date_time)
-        zinfo.external_attr = st[0] << 16L      # Unix attributes
+        zinfo.external_attr = (st[0] & 0xFFFF) << 16L      # Unix attributes
         if compress_type is None:
             zinfo.compress_type = self.compression
         else: