Paul Sijben wrote: > For some reason imp.load_module insists on getting a real open file as > the second parameter. I have not able to fool it with stringIO or > overloaded file objects. > > So now I have two questions: > 1) why does load_module insist on a real file > 2) is there a way around it that does not involve (say) tempfile?
imp.load_module is implemented in C. The API expects a file object or a file descriptor number. Internally the code creates a file pointer *FILE from a file descriptor. You have to create a temporary file. Christian -- http://mail.python.org/mailman/listinfo/python-list