Skip to content

install_yomitan_api.py crashes with KeyError on Windows when selecting "chromium" (missing registry_path) #37

Description

@creativeDev6

On Windows, running python install_yomitan_api.py and selecting the chromium option crashes with:

Traceback (most recent call last):
  File "C:\Tools\yomitan-api-master\install_yomitan_api.py", line 206, in <module>
    winreg.CreateKey(winreg.HKEY_CURRENT_USER, manifest_install_data["registry_path"])
KeyError: 'registry_path'

Cause: In PLATFORM_DATA["windows"]["manifest_install_data"], every browser entry (firefox, chrome, edge, brave) defines a registry_path key, but chromium does not:

"chromium": {
    "methods": ["file", "registry"],
    "path": DIR,
},

Since "registry" is still listed under "methods", the script tries to access the missing registry_path key and throws a KeyError.

Suggested fix: add a registry_path entry for chromium, e.g.:

"chromium": {
    "methods": ["file", "registry"],
    "path": DIR,
    "registry_path": f"SOFTWARE\\Chromium\\NativeMessagingHosts\\{NAME}",
},

This resolved the crash for me locally.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions