[issue4335] inspect.getsourcelines ignores last line in module

2010-12-01 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: 3.2 and 2.7 don't exhibit this issue. I added a test in r86922. -- nosy: -BreamoreBoy resolution: - out of date stage: patch review - committed/rejected status: open - closed

[issue4335] inspect.getsourcelines ignores last line in module

2010-07-18 Thread Mark Lawrence
Mark Lawrence breamore...@yahoo.co.uk added the comment: Ok so we missed the opportunity to backport this to 2.5.3, could we please get it into modern versions of Python, or what? -- nosy: +BreamoreBoy versions: +Python 3.2 -Python 2.6 ___ Python

[issue4335] inspect.getsourcelines ignores last line in module

2010-07-18 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: Martin, Was there a reason for not accepting this patch for the trunk? -- assignee: - belopolsky keywords: +easy ___ Python tracker rep...@bugs.python.org

[issue4335] inspect.getsourcelines ignores last line in module

2009-04-26 Thread Daniel Diniz
Changes by Daniel Diniz aja...@gmail.com: -- priority: - normal stage: - patch review type: - behavior versions: +Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4335 ___

[issue4335] inspect.getsourcelines ignores last line in module

2008-12-10 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: The patch has not been accepted for the trunk, so backporting it to 2.5.3 is out of scope at this point. -- nosy: +loewis versions: -Python 2.5.3 ___ Python tracker [EMAIL PROTECTED]

[issue4335] inspect.getsourcelines ignores last line in module

2008-12-09 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: Just to add to the list of getsource quirks: with the following in x.py, f = lambda: 0 \ [EOF] import inspect, x; inspect.getsource(x.f) Traceback (most recent call last): .. tokenize.TokenError: ('EOF in multi-line statement', (2, 0))

[issue4335] inspect.getsourcelines ignores last line in module

2008-12-09 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: You convinced me. After all, if python interpreter does not complain about missing end-of-line and processes the unterminated line, getsource should report it. Here is a patch that passes existing tests and adds a NoEOF test case. I

[issue4335] inspect.getsourcelines ignores last line in module

2008-12-08 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: In order to reproduce the reported problem I had to conjure the attached repro.py which is missing '\n' on the last line. I need to double check the language definition, but I feel this is not a bug because a file that ends with an

[issue4335] inspect.getsourcelines ignores last line in module

2008-12-08 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: According to my understanding of http://docs.python.org/reference/lexical_analysis.html#id1 a newline character is required at the end of the python file. ___ Python tracker [EMAIL PROTECTED]

[issue4335] inspect.getsourcelines ignores last line in module

2008-12-08 Thread Rafe Sacks
Rafe Sacks [EMAIL PROTECTED] added the comment: I feel this is not a bug because a file that ends with an unterminated line is not a well-formed python program. I used Komodo to make the file. Nothing special. I just made a new python document and used it. If there is a Komodo Bug that is fine,

[issue4335] inspect.getsourcelines ignores last line in module

2008-12-08 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: Rafe, Can you confirm that behavior on missing end-of-line is indeed your issue? Note that at first I could not even reproduce the problem based on your report. I am attaching a proof-of-concept patch that would arguably improve the

[issue4335] inspect.getsourcelines ignores last line in module

2008-12-08 Thread Zsolt Haraszti
Zsolt Haraszti [EMAIL PROTECTED] added the comment: We are also using inspect.getsourceline() in a large system at my company and we observed some unreliable behavior in the past which we never had time to analyze till today. Interesting coincidence, but today we finally took the effort and

[issue4335] inspect.getsourcelines ignores last line in module

2008-12-05 Thread Gabriel Genellina
Changes by Gabriel Genellina [EMAIL PROTECTED]: -- nosy: +gagenellina ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4335 ___ ___ Python-bugs-list

[issue4335] inspect.getsourcelines ignores last line in module

2008-12-02 Thread Alexander Belopolsky
Changes by Alexander Belopolsky [EMAIL PROTECTED]: -- nosy: +belopolsky ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4335 ___ ___ Python-bugs-list

[issue4335] inspect.getsourcelines ignores last line in module

2008-11-17 Thread Rafe Sacks
New submission from Rafe Sacks [EMAIL PROTECTED]: Hi, If the last line of the function is also the last line of the module, it is ignored. To repro: 1) Create module 'repro' module def test(): module_line_2 = None module_line_3 = None module_line_4 = None module_line_5 = None