try:
mode = os.stat(path).st_mode
print(str(S_ISDIR(mode)))
except Exception, e:
print("Error stating tile cache %s" % str(e))
Error stating tile cache [Errno 2] No such file or directory: '/tmp/tile_cache/mike'
ls /tmp/tile_cache -al
total 0
drwxr-xr-x 3 apache apache 60 Nov 6 11:07 .
drwxrwxrwt 58 root root 1380 Nov 6 11:07 ..
drwxrwxrwx 2 apache apache 860 Nov 6 11:07 mike