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.

classification
Title: compiler.transformer, "from module import *"
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jhylton Nosy List: felixwiemann, jhylton, mwh, syt
Priority: normal Keywords:

Created on 2004-10-31 20:20 by felixwiemann, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
t2.diff mwh, 2004-11-01 13:33 simple fix
Messages (9)
msg22953 - (view) Author: Felix Wiemann (felixwiemann) Date: 2004-10-31 20:20
import compiler.transformer
compiler.transformer.parse('from module import
*').getChildNodes()[0].getChildNodes()[0].lineno

... is 1 in Python 2.3 but None in Python 2.4b1.

lineno is 1 in Python 2.4 too when passing 'from module
import something' instead of 'from module import *'.
msg22954 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2004-11-01 11:41
Logged In: YES 
user_id=6656

I would guess that this is the result of the relatively recent 
changes to allow multiple line imports, but I don't really have time 
to play with this right now.  Do you have time to work on a fix?

If it does prove to be the multiple line import thing, you might 
want to pester Dima Dorfman -- I think that was his patch...
msg22955 - (view) Author: Felix Wiemann (felixwiemann) Date: 2004-11-01 13:03
Logged In: YES 
user_id=1014490

I neither have time nor knowledge to fix it, but it seems
that the error was introduced in rev. 1.45 of
transformer.py.  The author of rev. 1.45 is jhylton,
applying patch #1015989. Assigned this bug to him.
msg22956 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2004-11-01 13:33
Logged In: YES 
user_id=6656

Hmm, consider the attached.  It fixes the immediate issue,
and doesn't seem to break test_compiler.  I'd commit it, but
it's so obvious that I'm wondering why Jeremy didn't do this
in the first place: either I'm missing something a little
subtle, or Jeremy missed something really obvious :)
msg22957 - (view) Author: Thenault Sylvain (syt) Date: 2004-11-02 09:25
Logged In: YES 
user_id=387525

this doesn't seems to be related to the patch #101598 (i'm
the author of this patch). Using python 2.3, I get 1 as
lineno with or without the patch applied.
msg22958 - (view) Author: Felix Wiemann (felixwiemann) Date: 2004-11-02 10:44
Logged In: YES 
user_id=1014490

In fact, it does seem to be unrelated to the patch itself.

Instead, the missing lineno attribute is due to the
differences between rev. 1.44 with the patch applied and
rev. 1.45.  I.e., transformer.py was modified after applying
the patch but before checking it in.

URL of the patch:

http://sourceforge.net/tracker/download.php?group_id=5470&atid=305470&file_id=99117&aid=1015989
msg22959 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2004-11-02 13:50
Logged In: YES 
user_id=6656

Jeremy said in the issue that he'd changed things, so this
isn't a total surprise.  We're in b2 freeze now, so Jeremy
has until that is over to comment or I'll check this in :-)
msg22960 - (view) Author: Jeremy Hylton (jhylton) (Python triager) Date: 2004-11-07 03:04
Logged In: YES 
user_id=31392

This looks fine.
msg22961 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2004-11-08 12:18
Logged In: YES 
user_id=6656

Fixed in revision 1.49 of Lib/compiler/transformer.py.

Thanks for the review.
History
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 41109
2004-10-31 20:20:32felixwiemanncreate