Version 1.0.3
Version 1.0.3
-
Fixed an issue with
Container
andZipFile
in Python pre-3.8.When the name of a file added to container contained a non-ASCII character,
a consequentread()
of this file failed with an error:zipfile.BadZipFile: File name in directory 'FILE' and header b'FILE' differ.
After closing the ZipFile, reading files was OK.
As a solution, now the container is opened in read-only mode and all write operations
are performed after closing the read-only zipfile, opening it in append mode and
closing it again. -
Added a public property
zip_file
to theContainer
instance which uses a cached
read only zip file handle, opening it if necessary. -
Added a public property
zip_writer
to theContainer
instance which opens
an appendable zip file handle, clearing thezip_file
cache. -
Merged the
verify_container
and_verify_container_contents
methods
because the latter made little sense on its own as a private method. -
Replaced
_add_mimetype()
with_create_container()
which creates and initializes
the buffer in one single place. -
[#7] Added compatibility with Latvian edoc format - @vgaicuks