def path_exists_strict(path):
 try:
  os.stat(path)
 except OSError as err:
  if (err.errno in (errno.EPERM, errno.EACCES)):
   raise
  return False
 else:
  return True

def path_exists_strict ( path ) : try : os . stat ( path ) except OSError as err : if ( err . errno in ( errno . EPERM , errno . EACCES ) ) : raise return False else : return True
same as os .