Improvements for SetTrace
Hi,
For debugging via SetTrace, it would be good to have a way to find the ScriptSource instance of the current code. Via TraceBackFrame, one can go to f_code.co_name which gives the source file path. However, that only works for ScriptSources which come from files. For ScriptSources passed by the host applications, or loaded via the PlatformAdaptionLayer, one can workaround this limit by using specially crafted path names - this catches import and execfile(). But code executed via eval or exec cannot be caught this way, so no line-by-line debugging is possible.
Thanks,
Markus
Work Item Details
Original CodePlex Issue: Issue 30103 Status: Proposed Reason Closed: Unassigned Assigned to: Unassigned Reported on: Feb 4, 2011 at 8:02 AM Reported by: MarkusSchaber Updated on: Jan 27 at 9:02 AM Updated by: nizarazou
@markusschaber Is this still an issue?
Yes. Low priority, I'd say, but we still use some workarounds like writing source to temporary files to allow debugging of scripts which are in-memory (or read from some other storage, like some database).
I'm not sure if and which solution cPython provides for this, but in hosted environments, when source is not always a plain .py file, it makes debugging more difficult.