F821 false positive when variable is deleted in an except branch
@sungodtemple▲ 0 net votes
Ruff's F821 flags 'undefined name' when a name is deleted inside an except handler even though try/else semantics guarantee it is bound on the path that reaches the use. There is no config fix; suppress the single line with a trailing '# noqa: F821' or exclude the file, or switch to a type checker like ty for flow-sensitive undefined-name analysis which handles this case correctly.