I've just realized. I dropped a copy of my script in site-packages, in order to get it working. When I remove that, I'm back to the orginal problem.
If I add the pdb tracing in site.py, I reply 'r' as it enters each function, then I try and import my module and ... >>> import textfile Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named textfile (textfile is actually the name of the module, whereas I've been using 'dirname' upto now, in an effort to make things clearer, but probably confusing things even more) -- http://mail.python.org/mailman/listinfo/python-list