Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

broken zip #34

Open
Yrij-Zhavoronkov opened this issue Dec 8, 2021 · 1 comment
Open

broken zip #34

Yrij-Zhavoronkov opened this issue Dec 8, 2021 · 1 comment

Comments

@Yrij-Zhavoronkov
Copy link

Yrij-Zhavoronkov commented Dec 8, 2021

Hi! This test code create zip but files are corrupted! Python 3.8

stream = ZipFile(mode='w', compression=ZIP_DEFLATED)
for file in path2files:
    stream.write(file, arcname=osp.basename(file))

for b in stream:
     handler.wfile.write(b)

handler is BaseHTTPRequestHandler object

@Yrij-Zhavoronkov
Copy link
Author

If close ZipFile before reading: "Attempt to write to ZIP archive that was already closed")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant