s filenames may cause this function to raise an exception (in line with os.path.isdir() behavior). z