Commit 2746090
committed
prepare-sync: warn on close-cleanup failure (codeql)
PR-C.3 review fixup. The ``except Exception: pass`` after the
best-effort ``close_method()`` call tripped CodeQL's
``py/empty-except`` rule on two surfaces (code-quality + advanced
security). Cleanup is intentionally best-effort — a raise here
MUST NOT propagate or break sibling observers' dispatch — but
swallowing silently makes the rare cleanup-failure case
invisible.
Replace the empty pass with ``except Exception as close_error:``
followed by a ``warnings.warn`` mentioning the cleanup-failure.
Same isolation contract preserved (no propagation, no
sibling-blocking) but the swallow is now observable. CodeQL
``py/empty-except`` cleared on both surfaces.1 parent dae3da2 commit 2746090
1 file changed
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
427 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
428 | 437 | | |
429 | 438 | | |
430 | 439 | | |
| |||
0 commit comments