I ran into this by chance yesterday. What is happening is if a module is imported from a directory but the current directory has a subdirectory of the same name as the module the __file__ attribute does not turn out right.
if __name__ == "__main__":
...print "Name of __file__ is %s" % showproblem.__file__
if I run this within a directory without a subdirectory that has the same name as 'showproblem' everythings ok.
But if I run it in a directory with a subdirectory called 'showproblem', the __file__ is None.
Ive only verified it on Linux. I suspected that the whole mechanism was broken for awhile but after some testing have narrowed it to this case. I wager that for most of the time a user may not be affected by it. But when it does hit, it is odd. I couldn't get jyleo to run in my home directory because of this. Python appears to do it ok, so Im pretty sure this is a bug.
Stay connected, organized, and protected. Take the tour