def _GetFileByPath(self, key_path_upper):
<EOL>key_path_prefix, registry_file = self._GetCachedFileByPath(key_path_upper)<EOL>if not registry_file:<EOL><INDENT>for mapping in self._GetFileMappingsByPath(key_path_upper):<EOL><INDENT>try:<EOL><INDENT>registry_file = self._OpenFile(mapping.windows_path)<EOL><DEDENT>except IOError:<EOL><INDENT>registry_file = None<EOL><DEDENT>if not registry_file:<EOL><INDENT>continue<EOL><DEDENT>if not key_path_prefix:<EOL><INDENT>key_path_prefix = mapping.key_path_prefix<EOL><DEDENT>self.MapFile(key_path_prefix, registry_file)<EOL>key_path_prefix = key_path_prefix.upper()<EOL>break<EOL><DEDENT><DEDENT>return key_path_prefix, registry_file<EOL>
Retrieves a Windows Registry file for a specific path.

        Args:
          key_path_upper (str): Windows Registry key path, in upper case with
              a resolved root key alias.

        Returns:
          tuple: consists:

            str: upper case key path prefix
            WinRegistryFile: corresponding Windows Registry file or None if not
                available.