[wingide-users] import hook problems

Wingware Support support at wingware.com
Wed Nov 8 14:37:26 MST 2006


Maciej Fijalkowski wrote:
> Be aware that presence of any import magic may mean Wing won't be
>> able to find the modules' source code or correctly identify
>> breakpoints, but it depends on how it's done.  In short, the
>> source needs to be available on disk and the __file__ module
>> attribute or co_filename in the code objects should be set
>> to the full path to the source file.
> 
> 
> I know. But probably tracebacks should get there for users anyway. How it
> works:

Actually, the correct filenames are vital to setting breakpoints and 
displaying files in the editor.  A person can figure out which file a 
traceback refers to even if the filename is incomplete, but a program 
cannot.

> 1. pylib is having lazy imports, which allows one to write
> import py
> py.path.xxx
> 
> and this "just" works. WindIDE importhooks are trying to access __path__ of
> modules which are purely virtual
> (they really does not exist, are just some glue of that). This explodes in
> funny way, some random getattribute (cannot really track it, cause it's C
> anyway).

What sort of crash are you seeing?  An exception displayed in the IDE, a 
traceback in debug i/o, a segfault, or something else?

> Basically for tests:
> 
> svn co http://codespeak.net/svn/py/dist/
> 
> make sure you can access it
> 
> and try
> 
> import py
> from py.test import raises

When I try this, I get an AttributeError exception that can be safely 
ignored.  Once I ignore the exception by checking the ignore exception 
checkbox, the program continues.  I do run into problems in the py lib 
code because I'm using win32, but that's another issue.

Cheers,

John


More information about the wingide-users mailing list