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 摘要。