This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xdegaye
Recipients xdegaye
Date 2013-12-21.14:01:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Section 3.2 of 'The Python Language Reference' states:
  f_trace, if not None, is a function called at the start of each source code line

Run the attached and see that although f_trace is None in both cases when 'cmd' is either
'delete' or 'set', the second case raises a TypeError exception:
$ python
f_trace: None
delete start
delete done
f_trace: None
set start
Traceback (most recent call last):
  File "", line 19, in <module>
  File "", line 15, in foo
    print(cmd, 'done')
  File "", line 15, in foo
    print(cmd, 'done')
TypeError: 'NoneType' object is not callable

Also, the frame.f_lineno may be wrong in a traceback when f_trace is set to None because
PyFrame_GetLineNumber() does not handle this case.

The attached patch fixes this issue.
The patch also fixes issue 11992 and issue 20040.
The patch also fixes the dispatch_call() method of Bdb in the bdb module when the frame is a
generator and the previous command is next, until or return.
The patch also provides a backward compatible solution to the performance enhancement described in
issue 16672.
Date User Action Args
2013-12-21 14:01:27xdegayesetrecipients: + xdegaye
2013-12-21 14:01:27xdegayesetmessageid: <>
2013-12-21 14:01:27xdegayelinkissue20041 messages
2013-12-21 14:01:26xdegayecreate