diff --git a/src/bob/bio/base/database/utils.py b/src/bob/bio/base/database/utils.py index ca2a92b8ffad102a6e6831707d05d46051d0bd73..17e6bfd471920d880433143d4207ba6891e11019 100644 --- a/src/bob/bio/base/database/utils.py +++ b/src/bob/bio/base/database/utils.py @@ -599,8 +599,12 @@ def download_file( f"correspond to '{checksum}'." ) - # Extract only if the file was re-downloaded - if extract and needs_download: - local_file = extract_archive(local_file) + if extract: + # Extract only if the file was re-downloaded + if needs_download: + local_file = extract_archive(local_file) + else: + # Mimic the behavior of extract_archive + local_file = local_file.parent return local_file