[Python-bugs-list] Very long lines fool tracebacks (PR#75)
Fri, 10 Sep 1999 21:46:56 -0400 (EDT)
Full_Name: Tim Peters
Submission from: 1cust239.tnt4.bos1.da.uu.net (126.96.36.199)
The traceback-printing mechanism calls fgets with a buffer of 1000 chars.
Source lines larger than 1000 chars thus get treated as being more than one
line, causing the line actually printed to be off by a number of lines equal to
the number of times fgets gets fooled before reaching the target line number.
This popped up in c.l.py in what's likely the most unreasonable Python script
I've ever seen. I don't have a lot of sympathy for that, but the off-by-3 here
then off-by-4 there (etc) tracebacks only made a miserable situation laughable
I'll look into cheap ways to fix this, and submit a patch if I find one.