aboutcode-org / aboutcode-org/vulnerablecode

fix: Replace bare [except] with explicit `Exception` in pipes/advisory.py

未關閉
#2,074 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
702
分支
328
平均合併
3 天 8 小時
30 天內合併 PR
3

描述

## Summary

The file [vulnerabilities/pipes/advisory.py] contains a bare `except:` clause at line 459 which violates PEP 8 (E722) and can lead to unexpected behavior.

## Problem

Bare `except:` clauses catch **all** exceptions, including:
- `SystemExit` - prevents clean program termination
- `KeyboardInterrupt` - prevents Ctrl+C from working
- `GeneratorExit` - can break generator cleanup

## Location

**File:** [vulnerabilities/pipes/advisory.py]
**Line:** 459
**Current code:**
```python
except:
if logger:
logger(
f"Failed to create VulnerabilitySeverity for: {severity} with error:\n{traceback_format_exc()}",
level=logging.ERROR,
)

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。