Skip to content

pure_eval misses the variable on the crash line #805

@vmarkovtsev

Description

@vmarkovtsev

(Related to #748)

I keep experiencing the same situation for various crash reports in my project: the new "interesting variables" logic includes everything but the entities on the line where the crash happens. For example,

def foo(arg: Dict[str, str]):
    bar = arg[5]
    x = func()
    x.attr = "AttributeError"  # crash here
    ...

The visible variables in the stack trace are arg, bar, and even Dict[str, str] from typing (pufe_eval loves typing for some reason), but x - never. Yet the most important local stack information for me is the variables from the line where I raise an exception. I guess the variable suggestion logic can be hacked to prioritize the variables on that line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions