check whether a path is valid in python without creating a file at the path's target,"open(filename, 'r')"