Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure’s frames carry no module information #7796

Closed
twisted-trac opened this issue Feb 24, 2015 · 4 comments
Closed

Failure’s frames carry no module information #7796

twisted-trac opened this issue Feb 24, 2015 · 4 comments

Comments

@twisted-trac
Copy link

hynek's avatar @hynek reported
Trac ID trac#7796
Type enhancement
Created 2015-02-24 09:10:52Z

I was investigating why Sentry always showed me ? for culprits (= modules) and I dove deep into both Twisted and raven (the Python reporting client) and found the reason: twisted.python.failure._Frame has an empty f_globals and raven determines the name of the module by looking at f_globals["__name__"] which seems reasonable.

Is there a reason we don’t set this value other than it hasn’t been done yet?

Searchable metadata
trac-id__7796 7796
type__enhancement enhancement
reporter__hynek hynek
priority__normal normal
milestone__ 
branch__ 
branch_author__ 
status__closed closed
resolution__duplicate duplicate
component__core core
keywords__review review
time__1424769052740616 1424769052740616
changetime__1646554270309167 1646554270309167
version__None None
owner__None None
cc__hynek
@twisted-trac
Copy link
Author

exarkun's avatar @exarkun commented

Presumably there was no perceived need for this information. This is supported by the _Traceback docstring:

        Note that                                                                            
        although frames generally include locals and globals, this information                                                                         
        is not kept by this object, since locals and globals are not used in                                                                           
        standard tracebacks.

(Hooray, useful documentation.)

I don't see what would hurt about putting some of the simple data from the actual frame into the fake frame (documenting the motivation behind each piece, probably).

@twisted-trac
Copy link
Author

pdunning-xilinx's avatar @pdunning-xilinx commented

I've run into this when doing post mortem debugging.
It results in the variables appearing as not defined.

As, when the Failure object is cleaned (Failure.cleanFailure()), _safeReprVars() is called on the locals and globals, we can only save string versions of the variables at that point. That's still better than nothing from a debugging perspective.

@twisted-trac
Copy link
Author

pdunning-xilinx's avatar @pdunning-xilinx commented

Patch for review #1680

@twisted-trac
Copy link
Author

adiroiban's avatar @adiroiban set status to closed

Done via the PR for #9599

#1684

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant