def _OpenPathSpec(self, path_specification, ascii_codepage='cp1252'):
    """Opens the Windows Registry file specified by the path specification.

    Args:
      path_specification (dfvfs.PathSpec): path specification.
      ascii_codepage (Optional[str]): ASCII string codepage.

    Returns:
      WinRegistryFile: Windows Registry file or None.
    """
    if not path_specification:
      return None

    file_entry = self._file_system.GetFileEntryByPathSpec(path_specification)
    if file_entry is None:
      return None

    file_object = file_entry.GetFileObject()
    if file_object is None:
      return None

    registry_file = dfwinreg_regf.REGFWinRegistryFile(
        ascii_codepage=ascii_codepage)

    try:
      registry_file.Open(file_object)
    except IOError as exception:
      logger.warning(
          'Unable to open Windows Registry file with error: {0!s}'.format(
              exception))
      file_object.close()
      return None

    return registry_file
def _OpenPathSpec ( self , path_specification , ascii_codepage = 'cp1252' ) : if not path_specification : return None file_entry = self . _file_system . GetFileEntryByPathSpec ( path_specification ) if file_entry is None : return None file_object = file_entry . GetFileObject ( ) if file_object is None : return None registry_file = dfwinreg_regf . REGFWinRegistryFile ( ascii_codepage = ascii_codepage ) try : registry_file . Open ( file_object ) except IOError as exception : logger . warning ( 'Unable to open Windows Registry file with error: {0!s}' . format ( exception ) ) file_object . close ( ) return None return registry_file
Opens the Windows Registry file specified by the path specification.

    Args:
      path_specification (dfvfs.PathSpec): path specification.
      ascii_codepage (Optional[str]): ASCII string codepage.

    Returns:
      WinRegistryFile: Windows Registry file or None.