segfault with imp.load_module()

Rob Brown-Bayliss rob at zoism.org
Sat Apr 5 11:22:51 CEST 2003


Hi, I can do this in interactive python:

>>> f,n,d = imp.find_module("oda",["./items/"])
>>> print f,n,d
<open file './items/oda.py', mode 'r' at 0x82c6db8> ./items/oda.py
('.py', 'r', 1)
>>> it = imp.load_module("oda",f,n,d)
>>> print it
<module 'oda' from './items/oda.pyc'>

but this code:
file, filename, description = imp.find_module(item, ["./items/"])
print file, filename, description
item_module = imp.load_module(item,file, filename, description)
file.close()

gets this:

[rob at musicbox BHH-V]$ python utils.py
<open file './items/oda.py', mode 'r' at 0x81c2af8> ./items/oda.py
('.py', 'r', 1)
Segmentation fault


-- 

*  Rob Brown-Bayliss
*  =================	
*      zoism.org







More information about the Python-list mailing list