homepage

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 sbt
Recipients sbt
Date 2012年08月29日.14:54:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1346252079.7.0.669819400342.issue15812@psf.upfronthosting.co.za>
In-reply-to
Content
When inspect.getframeinfo() tries to collect lines of context it never shows the first line (unless context is as big as the number of lines in the file).
The relevant code is
 start = lineno - 1 - context//2
 try:
 lines, lnum = findsource(frame)
 except IOError:
 lines = index = None
 else:
--> start = max(start, 1)
 start = max(0, min(start, len(lines) - context))
 lines = lines[start:start+context]
 index = lineno - 1 - start
I think that
 start = max(start, 1)
should be replaced by
 start = max(start, 0)
For some reason getframeinfo() (and the functions which use it) don't seem to be tested by the testsuite...
History
Date User Action Args
2012年08月29日 14:54:39sbtsetrecipients: + sbt
2012年08月29日 14:54:39sbtsetmessageid: <1346252079.7.0.669819400342.issue15812@psf.upfronthosting.co.za>
2012年08月29日 14:54:39sbtlinkissue15812 messages
2012年08月29日 14:54:38sbtcreate

AltStyle によって変換されたページ (->オリジナル) /