[issue15812] inspect.getframeinfo() cannot show first line

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +942 ___ Python tracker ___ ___

[issue15812] inspect.getframeinfo() cannot show first line

2017-01-02 Thread Berker Peksag
Berker Peksag added the comment: You're right. Thanks for the review, Serhiy! -- ___ Python tracker ___ ___

[issue15812] inspect.getframeinfo() cannot show first line

2017-01-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2b6bdd6cd3f8 by Berker Peksag in branch '3.5': Issue #15812: Delete redundant max(start, 0) https://hg.python.org/cpython/rev/2b6bdd6cd3f8 New changeset 7cbcee0c53e3 by Berker Peksag in branch '3.6': Issue #15812: Merge from 3.5

[issue15812] inspect.getframeinfo() cannot show first line

2017-01-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: start is bounded to 0 twice. start = max(start, 0) start = max(0, min(start, len(lines) - context)) The first line can be just removed. Or two above lines can be rewritten as: start = min(start, len(lines) - context) start = max(start, 0)

[issue15812] inspect.getframeinfo() cannot show first line

2017-01-01 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the patch Sam and thanks for the ping Peter! -- components: +Library (Lib) nosy: +berker.peksag resolution: -> fixed stage: -> resolved status: open -> closed type: -> behavior versions: +Python 3.5, Python 3.6, Python 3.7

[issue15812] inspect.getframeinfo() cannot show first line

2017-01-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 15454cad5f27 by Berker Peksag in branch '3.5': Issue #15812: inspect.getframeinfo() now correctly shows the first line of a context https://hg.python.org/cpython/rev/15454cad5f27 New changeset 410caf255a09 by Berker Peksag in branch '3.6': Issue

[issue15812] inspect.getframeinfo() cannot show first line

2016-12-05 Thread Peter Waller
Peter Waller added the comment: I have just hit this bug and independently invented the exact fix of changing the zero for a one. Any chance of getting this merged? -- nosy: +Peter.Waller ___ Python tracker

[issue15812] inspect.getframeinfo() cannot show first line

2012-09-30 Thread Sam Breese
Sam Breese added the comment: Looking into this now. Should have a patch either later today or tommorow. -- nosy: +Sam.Breese ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15812 ___

[issue15812] inspect.getframeinfo() cannot show first line

2012-09-30 Thread Sam Breese
Sam Breese added the comment: Also, would you mind posting an example? I'm having trouble replicating. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15812 ___

[issue15812] inspect.getframeinfo() cannot show first line

2012-09-30 Thread Sam Breese
Sam Breese added the comment: Nevermind, replicated it. Changing start = max(start, 1) to start = max(start, 0) DOES fix. Writing a test case now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15812

[issue15812] inspect.getframeinfo() cannot show first line

2012-09-30 Thread Sam Breese
Sam Breese added the comment: Here's a patch. Very, very simple, just changed that one line in inspect.py and wrote a highly primitive test case for inspect.getframeinfo. The test isn't actually testing the primary functionality right now, just this one bug. I can probably write more

[issue15812] inspect.getframeinfo() cannot show first line

2012-08-29 Thread Richard Oudkerk
New submission from Richard Oudkerk: 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 =