Issue1143895
Created on 2005-02-18 16:26 by arigo, last changed 2005-03-12 16:39 by jlgijsbers.
| File name |
Uploaded |
Description |
Edit |
Remove |
|
inspect_bugs.diff
|
arigo,
2005-02-18 16:26
|
failing test cases |
|
|
|
msg24351 - (view) |
Author: Armin Rigo (arigo) |
Date: 2005-02-18 16:26 |
|
In a real-life case, inspect.getsource() used to
produce the correct result on 2.3 but no longer does on
2.4:
def somefunc(x, y): # comments
...body...
With 2.4 (and 2.5 CVS) the body is completely skipped
because the first line doesn't end with a colon. In my
opinion that's a critical problem for any code relying
on getsource(), even though such code can be considered
as relying on a large pile of fragile hacks in the
first place...
Attached is a patch for test_inspect.py, showing the
problem (also includes a different, much more
convoluted bug example). It seems that looking for and
around ':' in the first line isn't such a good idea;
relying more fully on the tokenizer would probably be a
better solution.
Assigned to jlgijsbers, as the author of the changes
that broke this (Dec 12th, 2004). (No blame intended,
the change was meant to fix a different bug, and it did
so.)
|
|
msg24352 - (view) |
Author: Johannes Gijsbers (jlgijsbers) |
Date: 2005-02-18 19:11 |
|
Logged In: YES
user_id=469548
Right now I don't have time to look into this bug deeply,
but I will do so this week. I'll note that the convoluted
example doesn't seem to be working under 2.3, though.
|
|
msg24353 - (view) |
Author: Johannes Gijsbers (jlgijsbers) |
Date: 2005-03-09 11:26 |
|
Logged In: YES
user_id=469548
Well, I'm sorry, but I can't make the time after all. I've
asked the author of the original patch to take a look at
this patch. Note that this code isn't yet in a 2.4 release,
so we could also back this out before 2.4.1.
|
|
msg24354 - (view) |
Author: Simon Percivall (percivall) |
Date: 2005-03-09 15:40 |
|
Logged In: YES
user_id=329382
Patch http://www.python.org/sf/1159931 fixes this problem.
|
|
msg24355 - (view) |
Author: Johannes Gijsbers (jlgijsbers) |
Date: 2005-03-12 16:39 |
|
Logged In: YES
user_id=469548
Simons patch has now been checked in on maint24 and HEAD.
|
|
| Date |
User |
Action |
Args |
| 2005-02-18 16:26:01 | arigo | create | |
|