You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The permission problem fixed by #493 for DirectoryStore remains in ZipStore. I looked at the zarr code and fix but couldn't figure out how to make a similar fix. Ideas welcome!
turns out the underlying problem is in zipfile.writestr, which initializes new archives with permissions 600.
defwritestr(self, zinfo_or_arcname, data,
compress_type=None, compresslevel=None):
"""Write a file into the archive. The contents is 'data', which may be either a 'str' or a 'bytes' instance; if it is a 'str', it is encoded as UTF-8 first. 'zinfo_or_arcname' is either a ZipInfo instance or the name of the file in the archive."""ifisinstance(data, str):
data=data.encode("utf-8")
ifnotisinstance(zinfo_or_arcname, ZipInfo):
zinfo=ZipInfo(filename=zinfo_or_arcname,
date_time=time.localtime(time.time())[:6])
zinfo.compress_type=self.compressionzinfo._compresslevel=self.compresslevelifzinfo.filename[-1] =='/':
zinfo.external_attr=0o40775<<16# drwxrwxr-xzinfo.external_attr|=0x10# MS-DOS directory flagelse:
zinfo.external_attr=0o600<<16# ?rw-------else:
zinfo=zinfo_or_arcname
I'm gonna open an issue in zipfile. One possible workaround for the time being would be to
create a zipinfo object mimicking the code above but with 755 permissions.
Minimal, reproducible code sample, a copy-pastable example if possible
Problem description
The permission problem fixed by #493 for DirectoryStore remains in ZipStore. I looked at the zarr code and fix but couldn't figure out how to make a similar fix. Ideas welcome!
Version and installation information
The text was updated successfully, but these errors were encountered: