Skip to content

Zip extraction issues #5

Description

@kolayne

for name in dirs:
shutil.rmtree(os.path.join(root, name))
except:
return "Failed to unzip file", 400

The action of deleting extra stuff should probably be performed even if something failed in the process of unzipping the file and inserting images into the database. Besides, it seems, your os.walk above should fail with an exception if one of the directories from the tree is deleted while inside the walk...

By the way, can you completely avoid the action of fully unzipping the archive? Is it possible to, instead, go through files in the archive and, having the cheks performed, extract just the images one by one?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions