Skip to content

Version 1.0.3

Compare
Choose a tag to compare
@jorgenader jorgenader released this 02 Sep 10:54
· 9 commits to main since this release
4423b72

Version 1.0.3

  • Fixed an issue with Container and ZipFile in Python pre-3.8.

    When the name of a file added to container contained a non-ASCII character,
    a consequent read() 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 the Container instance which uses a cached
    read only zip file handle, opening it if necessary.

  • Added a public property zip_writer to the Container instance which opens
    an appendable zip file handle, clearing the zip_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