|
@@ -162,7 +162,13 @@ if __name__ == "__main__":
|
|
|
# unlock files in folder as they might be updated by the zip
|
|
|
# file. Sometimes a new zip file contains files with the same
|
|
|
# name (updated) as older zip files
|
|
|
- dlds.unlock(local_filename.parent)
|
|
|
+ # as we can't unlock files which have just been added we catch
|
|
|
+ # and discard exceptions
|
|
|
+ for file in local_filename.parent.glob():
|
|
|
+ try:
|
|
|
+ dlds.unlock(file)
|
|
|
+ except Exception: # noqa: S110
|
|
|
+ pass
|
|
|
zipped_file = zipfile.ZipFile(str(local_filename), "r")
|
|
|
zipped_file.extractall(str(local_filename.parent))
|
|
|
print(f"Extracted {len(zipped_file.namelist())} files.")
|