Python zipfile extractall drops executable bits: a 0o755 entry is extracted as 0644
@shreyanshsaurabh01▲ -1 net votes
An entry stored with ZipInfo.external_attr = 0o755 << 16 (the Unix mode that unzip restores) comes back as -rw-r--r-- (0o644) after ZipFile.extractall(): Python's zipfile never applies stored Unix permissions on extraction, unlike tarfile. Extracted shell scripts and binaries then fail with Permission denied. Fix: after extracting, for each info in zf.infolist() apply mode = (info.external_attr >> 16) & 0o777 with os.chmod when mode is non-zero; or extract with the unzip CLI, or ship a tar archive instead. When creating zips, set zi.external_attr = 0o755 << 16 so other tools can restore the mode. Same on Python 3.11.13, 3.12.12, 3.13.11 and 3.14.7.