2.3a1: importhooks oddity

Hans Nowak wurmy at earthlink.net
Thu Jan 2 14:03:49 EST 2003


Just wrote:

> You may have to do sys.path_importer_cache.clear() to make sure no 
> handler is registered for the path (this is most likely a None value, 
> signalling it should use the builtin mechanism). Check PEP 302 for the 
> details. You should then get a "Wahey!" for each member of sys.path (and 
> as a bonus no file system import will work after you installed your hook 
> ;-)

Yes, this works... a whole slew of Wahey's. :-)  So it's not a bug, but this 
behavior is still a bit confusing, at least on Windows (as opposed to other 
platforms where it seems to work as expected). Is this the desired behavior? If 
I understand correctly, then registering any function or class in path_hooks is 
useless on Windows for path "", since it will be bypassed.

Cheers,

-- 
Hans (base64.decodestring('d3VybXlAZWFydGhsaW5rLm5ldA=='))
# decode for email address ;-)
The Pythonic Quarter:: http://www.awaretek.com/nowak/
Kaa:: http://www.awaretek.com/nowak/kaa.html





More information about the Python-list mailing list