celery/celery — pull request #1557 by mlissner (2013-09-25 20:29:14+00:00)
Title: Update tasks.rst

This is quite perplexing to me, but the following code always seems to return None:

os.path.dirname(os.path.basename(__file__))

I'm pretty sure this has been in the docs forever and it seemed to work, so I'm baffled why I am the first to discover this. Or maybe it didn't work?

Anyway, assuming I understand this correctly, I've changed it to:

sys.path.append(os.path.dirname(os.path.realpath(__file__)))

Which seems to actually do what the docs say is intended.