segfault with imp.load_module()

John Abel john.abel at pa.press.net
Sat Apr 5 04:49:38 EST 2003


Could this not have to do with your use of file as a variable?

Regards

John
----- Original Message ----- 
From: "Rob Brown-Bayliss" <rob at zoism.org>
To: "Python List" <python-list at python.org>
Sent: Saturday, April 05, 2003 10:22 AM
Subject: segfault with imp.load_module()


> 
> 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
> 
> 
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 





More information about the Python-list mailing list