The __file__ attribute is missing from globals when you run a module.
It runs fine from the command line, but trying to access it when under
debug just shows:
---------------------------------------------------------------
Name not found globally: name '__file__' is not defined
Traceback (innermost last):
File "<string>", line 1, in ?
File "d:...", line 221, in ?
sys.path.append(os.path.abspath(os.path.join(__file__, '../..')))
---------------------------------------------------------------
Hugh