I think the behavior Im seeing has to do with the java package import. I looked at the thing that was being imported when the __file__ attribute was garbage, and it was a java package not a module. Im not sure what the rule should be here, to bad there isn't a good 'import self' idiom that would resolve all this nuttiness.
On XP, the behavior when there isn't a subdirectory seems wrong. From what I could tell, the __file__ was None regardless of what was in the surround environ. I had to resort to a kludge by creating an empty python file called: joke.py. By importing joke.py I was able to get a picture of the filesystem where the running module was located.
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around