[Python] Create zipfile with directory entries in Python

Discussão em 'Python' iniciado por Stack, Junho 24, 2025.

  1. Stack

    Stack Membro Participativo

    For a unit test, I need a zipfile that contains directory entries. In a pinch, I could create one manually and keep it in the repo in binary form, but I'd rather create it dynamically as part of the test setup.

    Neither the zipfile module nor shutil.make_archive seems to be able to create directory entries. Is there a native-python solution?

    Continue reading...

Compartilhe esta Página