compress_type defaults to None which is ZipFile.write()'s default as well, so nothing changes for library consumers unaware of this change. There are no performance implications I can think of.
Use case: Wanting to write files to a ZIP archive opened using mode="w", compression="deflate" using the ZIP_STORE method--e.g. incompressible files (or, in my case, the leading "mimetype" file that absolutely must be archived using ZIP_STORE in order to produce OCF-conformant EPUB files.)
ZipFS: Support writing files with individual compress_type instead of always using the default set at ZipFS() instance creation time.
All this patch does is pass through the additional, optional compress_type parameter supported by ZipFile.write() since at least Python 2.6 through to the write() invocation (see https://docs.python.org/2.6/library/zipfile.html#zipfile.ZipFile.write up to https://docs.python.org/3.5/library/zipfile.html#zipfile.ZipFile.write -- there are no additional compatibility restrictions compared to the status quo.)
compress_type defaults to None which is ZipFile.write()'s default as well, so nothing changes for library consumers unaware of this change. There are no performance implications I can think of.
Use case: Wanting to write files to a ZIP archive opened using mode="w", compression="deflate" using the ZIP_STORE method--e.g. incompressible files (or, in my case, the leading "mimetype" file that absolutely must be archived using ZIP_STORE in order to produce OCF-conformant EPUB files.)