# 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 semantic change to the program. The program itself is trivial (z = True) and contains no isinstance or issubclass calls, so the rule would not have applied even if it existed. The crash is an environment/tooling issue unrelated to the rewrite's correctness.
- Program: minimized from 7 to 1 lines

## Reproducer

```python
z = True
```

## 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 original assignment sets z to True; after applying the (nonexistent) fix from rule UP038—which has been removed—no change occurs in source text but the linter crashes due to attempting to invoke a deleted rule. Since the transformation never actually rewrites the code, the program’s behavior remains identical to before any attempted fix. However, because the tool fails to complete linting, any downstream reliance on its output (e.g., assuming the fix was applied or that analysis succeeded) may lead to incorrect conclusions about correctness, effectively altering the perceived semantics of the development process rather than the program itself. No actual runtime difference arises from the diff, as none was produced.

## Upstream search

Queries: "UP038 fix", "ruff UP038 unused variable", "rule UP038 removal crash", "linter autofix deleted rule"

- related: https://github.com/astral-sh/ruff/issues/13051
  Existing report is about outdated documentation for UP038 fix safety, not a tool crash when the rule is removed.
- related: https://github.com/astral-sh/ruff/issues/7871
  Existing report is about UP038 rewriting code to be slower, not a tool crash due to rule removal.
- duplicate: https://github.com/astral-sh/ruff/issues/18349
  Existing report describes the same defect: enabling UP038 (a deprecated/removed rule) causes an error/crash because the rule no longer exists.

<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
- [github, open] New rule suggestion: flag identical stacked decorators — https://github.com/astral-sh/ruff/issues/26042
- [github, open] F401 autofix (adding import to `__all__`) should be unsafe — https://github.com/astral-sh/ruff/issues/18686
- [github, open] `UP037` causes runtime errors in Python 3.14 — https://github.com/astral-sh/ruff/issues/20782
- [github, closed] [Autofix Error] noqa Removed — https://github.com/astral-sh/ruff/issues/3676

</details>
