Skip to content

fix: use missing_ok=True in extension cache clear (import of github/spec-kit#3845) - #133

Open
one-kash wants to merge 1 commit into
mainfrom
import/pr-3845
Open

fix: use missing_ok=True in extension cache clear (import of github/spec-kit#3845)#133
one-kash wants to merge 1 commit into
mainfrom
import/pr-3845

Conversation

@one-kash

Copy link
Copy Markdown

Imported from upstream PR github#3845
Original author: @Quratulain-bilal
Original head branch: fix/extensions-cache-toctou


Summary

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

Changes

  • extensions/__init__.py: Use missing_ok=True in clear_cache() matching the pattern used for per-URL cache files

Replace check-then-act pattern (exists()+unlink()) with unlink(missing_ok=True)
to eliminate TOCTOU race condition. Matches the pattern already used for
per-URL cache files in the same method.
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.

2 participants