Skip to content

fix: use missing_ok=True in extension ZIP cleanup - #3870

Merged
mnriem merged 1 commit into
github:mainfrom
Quratulain-bilal:fix/extensions-commands-toctou
Sep 1, 2026
Merged

fix: use missing_ok=True in extension ZIP cleanup#3870
mnriem merged 1 commit into
github:mainfrom
Quratulain-bilal:fix/extensions-commands-toctou

Conversation

@Quratulain-bilal

Copy link
Copy Markdown
Contributor

Replace check-then-act pattern with unlink(missing_ok=True) to eliminate TOCTOU race condition in finally blocks.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Replaces TOCTOU-prone ZIP existence checks with atomic, tolerant cleanup.

Changes:

  • Uses Path.unlink(missing_ok=True) in both extension ZIP cleanup paths.
Show a summary per file
File Description
src/specify_cli/extensions/_commands.py Makes temporary ZIP cleanup race-safe.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@mnriem mnriem left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please resolve conflicts and pull in upstream/main

Replace check-then-act pattern with unlink(missing_ok=True) to eliminate
TOCTOU race condition in finally blocks.
@Quratulain-bilal
Quratulain-bilal force-pushed the fix/extensions-commands-toctou branch from 83a66f9 to 74254a6 Compare August 7, 2026 20:30
@mnriem
mnriem requested a balanced review from Copilot August 13, 2026 19:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@mnriem
mnriem self-requested a review September 1, 2026 21:30
@mnriem
mnriem merged commit e1617ce into github:main Sep 1, 2026
14 checks passed
@mnriem

mnriem commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

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.

3 participants