def StatEntryFromPath(path, pathspec, ext_attrs=True):
    'Builds a stat entry object from a given path.\n\n  Args:\n    path: A path (string value) to stat.\n    pathspec: A `PathSpec` corresponding to the `path`.\n    ext_attrs: Whether to include extended file attributes in the result.\n\n  Returns:\n    `StatEntry` object.\n  '
    try:
        stat = utils.Stat(path)
    except (IOError, OSError) as error:
        logging.error("Failed to obtain stat for '%s': %s", pathspec, error)
        return rdf_client_fs.StatEntry(pathspec=pathspec)
    return StatEntryFromStat(stat, pathspec, ext_attrs=ext_attrs)
Builds a stat entry object from a given path.

Args:
  path: A path (string value) to stat.
  pathspec: A `PathSpec` corresponding to the `path`.
  ext_attrs: Whether to include extended file attributes in the result.

Returns:
  `StatEntry` object.
def StatEntryFromPath(path, pathspec, ext_attrs=True):
    'Builds a stat entry object from a given path.\n\n  Args:\n    path: A path (string value) to stat.\n    pathspec: A `PathSpec` corresponding to the `path`.\n    ext_attrs: Whether to include extended file attributes in the result.\n\n  Returns:\n    `StatEntry` object.\n  '
    try:
        stat = utils.Stat(path)
    except (IOError, OSError) as error:
        logging.error("Failed to obtain stat for '%s': %s", pathspec, error)
        return rdf_client_fs.StatEntry(pathspec=pathspec)
    return StatEntryFromStat(stat, pathspec, ext_attrs=ext_attrs)