I could be naughty as not using:

   https://docs.python.org/3/c-api/reflection.html#c.PyFrame_GetLineNumber 
<https://docs.python.org/3/c-api/reflection.html#c.PyFrame_GetLineNumber>

    int f_lasti;                /* Last instruction if called */
    /* Call PyFrame_GetLineNumber() instead of reading this field
       directly.  As of 2.3 f_lineno is only valid when tracing is
       active (i.e. when f_trace is set).  At other times we use
       PyCode_Addr2Line to calculate the line from the current
       bytecode index. */
    int f_lineno;               /* Current line number */
    int f_iblock;               /* index in f_blockstack */
    char f_executing;           /* whether the frame is still executing */
    PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */
    PyObject *f_localsplus[1];  /* locals+stack, dynamically sized */

In other words, I am accessing f_lineno directly which may not work correctly 
now.

Have to remember some of this code was written a very very long time ago. :-)

Graham

> On 7 Feb 2018, at 3:32 pm, Jesus Cea <[email protected]> wrote:
> 
> On 07/02/18 05:22, Graham Dumpleton wrote:
>> I'll look into. Python stack traces are a bit of a pain as they don't
>> give a separate stack frame for when you call a function which is
>> actually implemented in C code. Usually though one can at least work
>> out the line in calling code where C function was called though. At
>> least that is the case if using profile hooks. Don't remember what
>> happens with stack frame dumping.
> 
> I am hitting this issue myself in other project. Look like a bug of
> "feature missing" of Python interpreter. Maybe something to work for
> Python 3.8, two years away.
> 
> What I am experiencing now is something different. I just send an email
> about it.
> 
> 5:30 AM in Spain, time for some sleep!.
> 
> -- 
> Jesús Cea Avión                         _/_/      _/_/_/        _/_/_/
> [email protected] - http://www.jcea.es/     _/_/    _/_/  _/_/    _/_/  _/_/
> Twitter: @jcea                        _/_/    _/_/          _/_/_/_/_/
> jabber / xmpp:[email protected]  _/_/  _/_/    _/_/          _/_/  _/_/
> "Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
> "My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
> "El amor es poner tu felicidad en la felicidad de otro" - Leibniz
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/modwsgi.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to