From: Andrew M. Kuchling Date: Sat, 10 Jul 2004 15:40:29 +0000 (+0000) Subject: [Bug #835415] AIX can return modes that are >65536, which causes an OverflowError... X-Git-Tag: v2.4a2~342 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=55430213c55b74a256e0b7e3f35234249b574a9b;p=python [Bug #835415] AIX can return modes that are >65536, which causes an OverflowError. Fix from Albert Chin --- diff --git a/Lib/zipfile.py b/Lib/zipfile.py index b1943c17a9..4f200c2537 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -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: