[Stackless] Having an import issue on my embedded stackless port

Richard Tew richard.m.tew at gmail.com
Tue Jan 27 20:20:44 CET 2009

On Tue, Jan 27, 2009 at 1:58 PM, Nelsen, Patrick
<Patrick.Nelsen at spectrumdsi.com> wrote:
> I'm currently working on porting stackless 2.6.1 to an embedded OS, with a
> custom filesystem.  I am successfully able to import the builtin modules and
> modules in zipfiles, but I am having trouble importing .py files as
> modules.  I started to trace through the find_module() method in import.c
> and I see that the line 1326:  if(loader != Py_None) is always true and I
> hit the continue statement never making the call to fopen().  In addition,
> when I do a print of sys.path_importer_cache, all of the key values return
> imp.NULLImporter  object.  I was thinking that this was causing my problem,
> but I'm not sure why and how to fix it.

This was asked by your colleague the other day:

This is a problem which you would encounter even if you were not using
Stackless, that is, using standard Python.  To ask us alone about
this, is ineffectual compared to the benefit you would get if you
asked the Python community in general.  If quick resolution to your
Stackless related questions is important to you, ensure you have asked
yourself first if it is actually a standard Python problem, and
depending on the answer then going to the place with the widest
relevant audience.  You might have already done this, I do not know.

In any case.  Yes, I've had this problem and worked around it before.
No, I don't remember what the cause was but it was a world of pain
where with no operating system and the only way to debug, to add
prints to the import mechanism.  I don't wish to revisit it.  But,
that said, you could do the following:

1. Go to http://disinterest.org/NDS/Python25.html and download
2. Go to http://www.stackless.com/download and download
3. Diff the two.  Note the changes which were made and see if you can
isolate any which might be relevant.


More information about the Stackless mailing list