fixhunt

ruff UP038: tool crashes

tool-crashlabelled unknownprogram-bug · lowduplicate
Findings / 2026-10-17T21-20-52-142Z-httm-ruff-UP038 / r2-p007ruff 0.17.110 → 3 lines2026-10-17 21:20 UTC

Hypothesis Nemotron 3 Super predicted to fire did not fire

class attributes vs instance attributes, descriptors, properties with side effects

Program

before
1class A:
2 def prop(self):
3 return self._val
after
1(no fix applied)

Output

stdout beforeexit 0
(no stdout)
stdout afternot run
(not run)
fired
0 before · 0 after
runs
each version twice, same file name, no network

Judge Nemotron 3 Ultra advisory program-bug · 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 contains no isinstance or issubclass calls, so the rule would not have matched anything. The observed failure is a tool availability issue, not a semantic change from a fix.

Explanation Nemotron 3 Super unverified

The fix attempts to remove or replace the property method but applies no actual change; however, because rule UP038 has been deleted from Ruff’s rule set, selecting it causes the linter to crash before any transformation occurs. Since the tool fails to run, no code is processed or emitted, so the original program is not analyzed or altered as intended. The observed difference—tool failure instead of a successful lint run—means the intended semantics-preserving rewrite cannot be applied, and the absence of any output or modification breaks the expected behavior of the toolchain, even though the source code remains unchanged. This is not a semantic change in the program but a failure in the tool’s execution due to an invalid rule reference.

Reproduce

file
prog.py (the before program)
minimized program
r2-p007.py
evidence sheet
r2-p007.md
regression fixture
r2-p007.py the minimized program with a header stating the observed change, for the tool's test suite
python3 prog.py
ruff check --preview --isolated --select UP038 --fix prog.py
python3 prog.py

Upstream search GitHub issues Tavily Nemotron 3 Super + Ultra

UP038 fix · ruff UP038 property method · remove unused private attribute · UP038 rule deletion crash

  • related astral-sh/ruff/issues/13051 Existing report concerns outdated documentation for UP038, while the new finding is a tool crash due to the rule being removed.
  • related astral-sh/ruff/issues/7871 Existing report concerns UP038 rewriting isinstance checks incorrectly, while the new finding is a tool crash due to the rule being removed.
  • duplicate astral-sh/ruff/issues/18349 Existing report describes the same defect: selecting deprecated/removed rule UP038 causes an error/crash.

Details

program
Class vs instance attributes, descriptors, properties
hazard
class attributes vs instance attributes, descriptors, properties with side effects
oracle
lint crashed: ruff failed Cause: Rule `UP038` was removed and cannot be selected.
run
2026-10-17T21-20-52-142Z-httm-ruff-UP038
generated program (10 lines) and the fix's diff
1class A:
2 attr = 1
3 @property
4 def prop(self):
5 return self._val
6 def __init__(self):
7 self._val = 2
8a = A()
9isinstance(a.attr, (int,))
10isinstance(a.prop, (int,))
rule documentation given to the models
# non-pep604-isinstance (UP038)

Derived from the **pyupgrade** linter.

Fix is always available.

## Removed
This rule was removed as using [PEP 604] syntax in `isinstance` and `issubclass` calls
isn't recommended practice, and it incorrectly suggests that other typing syntaxes like [PEP 695]
would be supported by `isinstance` and `issubclass`. Using the [PEP 604] syntax
is also slightly slower.

## What it does
Checks for uses of `isinstance` and `issubclass` that take a tuple
of types for comparison.

## Why is this bad?
Since Python 3.10, `isinstance` and `issubclass` can be passed a
`|`-separated union of types, which is consistent
with the union operator introduced in [PEP 604].

Note that this results in slower code. Ignore this rule if the
performance of an `isinstance` or `issubclass` check is a
concern, e.g., in a hot loop.

## Example
```python
isinstance(x, (int, float))
```

Use instead:
```python
isinstance(x, int | float)
```

## Options
- `target-version`

## References
- [Python documentation: `isinstance`](https://docs.python.org/3/library/functions.html#isinstance)
- [Python documentation: `issubclass`](https://docs.python.org/3/library/functions.html#issubclass)

[PEP 604]: https://peps.python.org/pep-0604/
[PEP 695]: https://peps.python.org/pep-0695/