From 52fe2f74d8a23e1cf12530a24ded233a0db32e9d Mon Sep 17 00:00:00 2001 From: Maximilian Haye Date: Wed, 30 Oct 2024 15:47:14 +0100 Subject: [PATCH] fix: set permissions on package dirs Defaulted to 0 previously, which caused problems trying to unpack, inspect and modify built packages. --- questionpy_sdk/package/builder.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/questionpy_sdk/package/builder.py b/questionpy_sdk/package/builder.py index d23e8a2..b15a099 100644 --- a/questionpy_sdk/package/builder.py +++ b/questionpy_sdk/package/builder.py @@ -249,6 +249,9 @@ def _ensure_directory_entries(self, path: Path) -> None: zipinfo = zipfile.ZipInfo(strpath, date_time=datetime.datetime.now(tz).timetuple()[:6]) zipinfo.compress_type = self.COMPRESS_TYPE zipinfo.CRC = 0 # TODO: remove once bug is resolved (https://github.com/python/cpython/issues/119052) + # There is a great summary of the external attributes field here: https://unix.stackexchange.com/a/14727 + zipinfo.external_attr = 0o40755 << 16 # Unix mode drwxr-xr-x + zipinfo.external_attr |= 0b10000 # DOS directory attribute self._zipfile.mkdir(zipinfo) def __exit__(