[IronPython] Regression with importing in pre b5

Dan Eloff dan.eloff at gmail.com
Wed Sep 10 04:08:17 CEST 2008


I tried to reproduce it and failed. I went back in time in the svn to
look at the original code that triggers it, and it uses the importing
format you use here. As you point out this won't run under IronPython
or CPython. Granted it fails spectacularly under IronPython, but maybe
that failure can be reproduced in CPython as well. I don't know as I
have been unable to reproduce it so far outside of the original
environment.

Parent "test" package has a file called galaxy_map that contains a
class GalaxyMap as well, which is imported by interface after "from
test import templates" But I tried that in your test setup below and I
got nothing but the same simple failure.

Bottom line, is "from subpkg import foo" illegal? It's not a
regression if it shouldn't have worked in b3 anyway. I'm sure you'd
agree that your time is better spent on fixing things that should
work. But if "from subpkg import foo" is allowable in some cases, then
it may be worth fixing this bug. I'm willing to put in the effort
required to make a reproduction if you still want to fix this, just
let me know.

-Dan

On Tue, Sep 9, 2008 at 6:53 PM, Dino Viehland <dinov at microsoft.com> wrote:
> Do you have more info on this one?  I've setup a package structure like:
>
> test\
>        __init__.py:
>                print 'test.__init__'
>                import interface
>        interface.py:
>                print 'test.interface'
>                import templates
>        templates\
>                __init__.py:
>                        print 'test.templates.__init__'
>                        from templates.galaxy_map import GalaxyMap              # passes if I remove templates.
>                galaxy_map.py:
>                        print 'test.templates.galaxy_map'
>                        class GalaxyMap: pass
>
>
> this fails on both CPython & IronPython because of "from templates.galaxy_map import GalaxyMap" but it doesn't do the import twice behavior you were seeing.  It also passes if I change from templates.galaxy_map ... to just from galaxy_map ...  so I'm guessing I haven't setup the repro 100% accurately.  Can you point me at what I'm doing wrong?  Maybe there's another package somewhere that collides with one of these names or something else strange?
>
>
> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff
> Sent: Friday, September 05, 2008 11:04 PM
> To: Discussion of IronPython
> Subject: Re: [IronPython] Regression with importing in pre b5
>
> On Sat, Sep 6, 2008 at 12:04 AM, Curt Hagenlocher <curt at hagenlocher.org> wrote:
>> On Fri, Sep 5, 2008 at 5:16 PM, Dan Eloff <dan.eloff at gmail.com> wrote:
>>> I'm going to make a lot of work for you guys before the day is out :)
>>> Maybe I should be posting these to the Issue Tracker? I'm just
>>> concerned they will get lost in the noise.
>>
>> Absolutely.  Any problems you find *please* enter them as bugs into Codeplex!
>>
>
> Be careful what you wish for :)
>
> http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18346
>
> -Dan
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>



More information about the Ironpython-users mailing list