[issue6700] inspect.getsource() returns incorrect source lines at the module level

2018-08-26 Thread Tal Einat


Tal Einat  added the comment:

Thanks for reporting this, Gabriel!

Thanks for the PR, Vladimir!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6700] inspect.getsource() returns incorrect source lines at the module level

2018-08-26 Thread Tal Einat


Tal Einat  added the comment:


New changeset 491740f116755e220135e596ec802ea3a0f65596 by Tal Einat in branch 
'2.7':
[2.7] bpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks 
(GH-8864)
https://github.com/python/cpython/commit/491740f116755e220135e596ec802ea3a0f65596


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6700] inspect.getsource() returns incorrect source lines at the module level

2018-08-24 Thread miss-islington


miss-islington  added the comment:


New changeset 3e6020c4ddf7acea91efdae770320c6ce06b93db by Miss Islington (bot) 
in branch '3.7':
bpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks 
(GH-8864)
https://github.com/python/cpython/commit/3e6020c4ddf7acea91efdae770320c6ce06b93db


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6700] inspect.getsource() returns incorrect source lines at the module level

2018-08-24 Thread miss-islington


miss-islington  added the comment:


New changeset 0e707b4c6a47086d8e723c7a010c3f5cf8296946 by Miss Islington (bot) 
in branch '3.6':
bpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks 
(GH-8864)
https://github.com/python/cpython/commit/0e707b4c6a47086d8e723c7a010c3f5cf8296946


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6700] inspect.getsource() returns incorrect source lines at the module level

2018-08-24 Thread Tal Einat


Change by Tal Einat :


--
pull_requests: +8371

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6700] inspect.getsource() returns incorrect source lines at the module level

2018-08-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8369

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6700] inspect.getsource() returns incorrect source lines at the module level

2018-08-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8370

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6700] inspect.getsource() returns incorrect source lines at the module level

2018-08-24 Thread Tal Einat


Tal Einat  added the comment:


New changeset 91cb298f811961277fd4cc4a32211899d48bedcb by Tal Einat (Vladimir 
Matveev) in branch 'master':
bpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks 
(GH-8864)
https://github.com/python/cpython/commit/91cb298f811961277fd4cc4a32211899d48bedcb


--
nosy: +taleinat

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6700] inspect.getsource() returns incorrect source lines at the module level

2018-08-23 Thread Tal Einat


Change by Tal Einat :


--
versions: +Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6700] inspect.getsource() returns incorrect source lines at the module level

2018-08-23 Thread Tal Einat


Change by Tal Einat :


--
versions: +Python 3.8 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6700] inspect.getsource() returns incorrect source lines at the module level

2018-08-22 Thread Vladimir Matveev


Change by Vladimir Matveev :


--
pull_requests: +8338

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6700] inspect.getsource() returns incorrect source lines at the module level

2018-08-16 Thread Aivar Annamaa


Change by Aivar Annamaa :


--
title: inspect.getsource() returns incorrect source lines -> 
inspect.getsource() returns incorrect source lines at the module level
versions: +Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6700] inspect.getsource() returns incorrect source lines

2018-08-16 Thread Aivar Annamaa


Change by Aivar Annamaa :


--
nosy: +Aivar.Annamaa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6700] inspect.getsource() returns incorrect source lines

2015-01-17 Thread Claudiu Popa

Changes by Claudiu Popa pcmantic...@gmail.com:


--
nosy: +Claudiu.Popa, yselivanov
versions: +Python 3.5 -Python 2.6, Python 2.7, Python 3.1, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6700
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6700] inspect.getsource() returns incorrect source lines

2013-05-22 Thread James Saryerwinnie

James Saryerwinnie added the comment:

I confirmed the issue in tip.  One of the issues with the original patch is
that it modifies the tokeneater method used by getblock which won't work
if the first token is any of the special cased tokens in the original patch
('@', 'def', 'class').  I've added additional tests that show where the
original patch fails.

An alternative approach is to check in getsourcelines whether or not we're
dealing with a traceback or frame object in the module scope, and if so,
return the lines of the entire module.  I've attached an updated patch
that implements this along with additional tests.

--
nosy: +James.Saryerwinnie
Added file: http://bugs.python.org/file30344/issue6700.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6700
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6700] inspect.getsource() returns incorrect source lines

2010-04-08 Thread Daniel Diniz

Daniel Diniz aja...@gmail.com added the comment:

Confirmed in trunk and py3k. Also affects inspect.getsourcelines.

--
nosy: +ajaksu2
priority:  - normal
stage:  - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6700
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6700] inspect.getsource() returns incorrect source lines

2009-08-13 Thread Gabriel Genellina

New submission from Gabriel Genellina gagsl-...@yahoo.com.ar:

inspect.getsource(obj) returns incorrect results when obj is a 
traceback or frame object outside any function (that is, at the module 
level).

This demo script shows the problem. The correct output should contain 
all source lines in the module, but it only returns the first two:


D:\temptype show_inspect_bug.py
def foo(x):
  return y + z

import inspect
frame = inspect.currentframe()
print inspect.getsource(frame)


D:\temppython show_inspect_bug.py
def foo(x):
  return y + z


The attached patch fixes the problem and adds some missing test cases.
Originally reported by Juanjo Conti at the local Python group.

--
components: Library (Lib)
files: inspect.diff
keywords: patch
messages: 91541
nosy: gagenellina
severity: normal
status: open
title: inspect.getsource() returns incorrect source lines
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file14716/inspect.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6700
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6700] inspect.getsource() returns incorrect source lines

2009-08-13 Thread Gabriel Genellina

Changes by Gabriel Genellina gagsl-...@yahoo.com.ar:


Added file: http://bugs.python.org/file14717/show_inspect_bug.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6700
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com