If a function (or other non-string object) is accidentally passed as an argument to os.path.join() the result is an AttributeError:
In [3]: os.path.join(fn, "path")
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/home/tom/<ipython-input-3-44b097ceab04> in <module>()
----> 1 os.path.join(fn, "path")
/usr/lib/python2.7/posixpath.pyc in join(a, *p)
66 if b.startswith('/'):
67 path = b
---> 68 elif path == '' or path.endswith('/'):
69 path += b
70 else:
AttributeError: 'function' object has no attribute 'endswith'