# ruff UP038: tool crashes

Internal evidence sheet generated by fixhunt. Not an issue text. A human re-verifies, checks the duplicates
below, and writes the upstream report in their own words following the project's AI policy.

- Tool: ruff ruff 0.17.1
- Rule: UP038 (tool labels the fix: unknown)
- Oracle: tool-crash
- Judge (Nemotron 3 Ultra, advisory): program-bug, severity low. The linter crashed because rule UP038 was removed from the codebase and cannot be selected, not because of any rewrite applied to the program. The program itself was never transformed, so there is no semantic difference to evaluate.
- Program: minimized from 7 to 4 lines

## Reproducer

```python
try:
    print('Before:', result)
except Exception as e:
    print('Before error:', type(e).__name__, str(e))
```

## Commands

```sh
python3 prog.py
ruff check --preview --isolated --select UP038 --fix prog.py
python3 prog.py
```

## Observed

```
lint crashed: ruff failed
  Cause: Rule `UP038` was removed and cannot be selected.
```

## Diff applied by the fix

```diff

```

## Why the rewrite is not equivalent (model draft, verify before use)

The diff shows no change to the source code; however, because rule UP038 has been removed from Ruff, attempting to apply its fix causes the linter to crash before any transformation occurs. Since no actual rewrite is performed, there is no altered program behavior to compare—the observed failure is solely due to the tool’s inability to execute the rule, not a semantics‑preserving or altering code change. Thus, the explanation of differing behavior does not apply here; the issue is a tool failure, not a semantic difference in the program.

## Upstream search

Queries: "UP038 fix", "ruff UP038 try except", "rule UP038 exception handling", "UP038 lint crash removal"

- related: https://github.com/astral-sh/ruff/issues/13051
  Existing report is about outdated documentation for deprecated rule UP038, not a tool crash when selecting it.
- related: https://github.com/astral-sh/ruff/issues/7871
  Existing report is about UP038 producing slower rewrites on isinstance tuples, not a crash when the rule is selected.
- duplicate: https://github.com/astral-sh/ruff/issues/18349
  Existing report describes the same crash: selecting deprecated rule UP038 causes a tool crash because the rule was removed.

<details><summary>All hits</summary>

- [github, closed] `UP038` documentation outdated wrt. fix safety — https://github.com/astral-sh/ruff/issues/13051
- [github, closed] UP038 rewrites code to make it slower and more verbose — https://github.com/astral-sh/ruff/issues/7871
- [github, closed] Warn about error being related to a deprecated rule — https://github.com/astral-sh/ruff/issues/18349
- [github, closed] [Bug] [DOC501 & DOC502] Numpy still docstrings with `:exc:` directive for exceptions are falsely flagged — https://github.com/astral-sh/ruff/issues/14609
- [github, closed] `# flake8: noqa` top-of-the-file comment doesn't respect `external` config — https://github.com/astral-sh/ruff/issues/10202
- [github, closed] Fixed code unformatted — https://github.com/astral-sh/ruff/issues/8619
- [github, closed] Add option to disable preview warnings — https://github.com/astral-sh/ruff/issues/8620
- [github, closed] Implement pyupgrade — https://github.com/astral-sh/ruff/issues/827

</details>
