# 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, so no fix was actually applied to the source code. The observed difference is a tool execution failure unrelated to the rewrite semantics.
- Program: minimized from 4 to 3 lines

## Reproducer

```python
from typing import List
x = [1]
print(isinstance(x, (List[int],)))
```

## 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 code checks if x is an instance of a tuple containing the type annotation List[int]; however, due to type erasure, isinstance with generic types like List[int] always returns False at runtime because the type parameter int is not available. The attempted rewrite likely tried to simplify or remove the check incorrectly—perhaps by replacing it with a direct isinstance against list—or assumed the generic could be evaluated, which changes the behavior: the original expression evaluates to False (since List[int] erases to list but isinstance still fails), while an incorrect rewrite might yield True or raise an error, thus altering program semantics. Since the rule was removed, no valid fix exists, and any such transformation would be unsafe.

## Upstream search

Queries: "UP038 fix", "ruff UP038 isinstance tuple type annotation", "typing List isinstance crash removal", "rule UP038 deprecated isinstance fix"

- related: https://github.com/astral-sh/ruff/issues/13051
  Existing report is about outdated documentation for deprecated rule UP038, not a crash when selecting the removed rule.
- related: https://github.com/astral-sh/ruff/issues/7871
  Existing report is about UP038 rewriting isinstance checks to slower code, not a crash due to rule removal.
- related: https://github.com/astral-sh/ruff/issues/18349
  Existing report is about warning for deprecated rule UP038, not a crash when the removed rule is selected.

<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] Rule Documentation UX improvement suggestions: navigation + link to source — https://github.com/astral-sh/ruff/issues/13367

</details>
