Skip to content

Fix Ubuntu Opera cache extraction conflict causing NotADirectoryError#730

Merged
aleksandr-kotlyar merged 4 commits into
SergeyPirogov:masterfrom
aleksandr-kotlyar:fix/ubuntu-opera-cache-file-dir-conflict
May 17, 2026
Merged

Fix Ubuntu Opera cache extraction conflict causing NotADirectoryError#730
aleksandr-kotlyar merged 4 commits into
SergeyPirogov:masterfrom
aleksandr-kotlyar:fix/ubuntu-opera-cache-file-dir-conflict

Conversation

@aleksandr-kotlyar

Copy link
Copy Markdown
Collaborator

This PR fixes an Ubuntu CI failure in Opera driver install flow:

NotADirectoryError: .../.wdm/drivers/operadriver/.../operadriver

Root cause:

  • stale cache can contain a file where a new archive expects a directory
    (file/dir name collision at top-level archive entries).
  • zip.extractall() then fails with NotADirectoryError.

Fix:

  • In FileManager.__extract_zip, pre-scan archive entries and remove stale
    conflicting files in target directory before extraction.

Added regression test:

  • tests/test_file_manager.py::test_extract_zip_removes_file_dir_conflict
    reproduces the file-vs-directory collision and verifies extraction succeeds.

Why this is safe:

  • cleanup is narrowly scoped to top-level paths required as directories by the archive.
  • does not alter normal extraction flow when no conflict exists.

@aleksandr-kotlyar aleksandr-kotlyar merged commit 8651fa2 into SergeyPirogov:master May 17, 2026
7 checks passed
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

Successfully merging this pull request may close these issues.

1 participant