Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5543021

Browse files
committed
[Bug #835415] AIX can return modes that are >65536, which causes an OverflowError. Fix from Albert Chin
1 parent f9ea7c0 commit 5543021

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/zipfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def write(self, filename, arcname=None, compress_type=None):
396396
zinfo = ZipInfo(filename, date_time)
397397
else:
398398
zinfo = ZipInfo(arcname, date_time)
399-
zinfo.external_attr = st[0] << 16L # Unix attributes
399+
zinfo.external_attr = (st[0] & 0xFFFF) << 16L # Unix attributes
400400
if compress_type is None:
401401
zinfo.compress_type = self.compression
402402
else:

0 commit comments

Comments
 (0)