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

Unable to create zip file in same directory as files to be zipped #35

Open
Frankyboy100880 opened this issue Aug 4, 2020 · 0 comments

Comments

@Frankyboy100880
Copy link

Frankyboy100880 commented Aug 4, 2020

Image that you a directory C:\MyDirectory with some files and you wanted to create a Zip-File of C:\MyDirectory with name C:\MyDirectory\mydirectory.zip. In this case the keyword

create_zip_from_files_in_directory( "C:\MyDirectory", "C:\MyDirectory\mydirectory.zip")

is creating an infinite loop by always trying to zip its own zip-file.

My guess is, that the following two lines must be interchanged:

the_zip = zipfile.ZipFile(filename, "w")
files = return_files_lists(directory, sub_directories)
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