{"record":{"id":"56e38aa2e5a0a348","repo":"kovidgoyal/kitty","slug":"ignoring-invalid-config-line-line-r","errorCode":null,"errorMessage":"Ignoring invalid config line: {line!r}","messagePattern":"Ignoring invalid config line: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kitty/conf/utils.py","lineNumber":292,"sourceCode":"        return False\n\n\ndef parse_line(\n    line: str,\n    parse_conf_item: ItemParser,\n    ans: dict[str, Any],\n    base_path_for_includes: str,\n    effective_config_lines: Callable[[str, str], None],\n    memory: Memory,\n    accumulate_bad_lines: list[BadLine] | None = None,\n    allow_geninclude: bool = True,\n) -> None:\n    line = line.strip()\n    if not line or line.startswith('#'):\n        return\n    m = key_pat.match(line)\n    if m is None:\n        log_error(f'Ignoring invalid config line: {line!r}')\n        return\n    key, val = m.groups()\n    if key.endswith('include') and key in include_keys:\n        val = expandvars(os.path.expanduser(val.strip()), {'KITTY_OS': os_name()})\n        if key == 'globinclude':\n            from pathlib import Path\n\n            vals = tuple(map(lambda x: str(os.fspath(x)), sorted(Path(base_path_for_includes).glob(val))))\n        elif key == 'envinclude':\n            from fnmatch import fnmatchcase\n\n            for x in os.environ:\n                if fnmatchcase(x, val):\n                    with currently_parsing.set_file(f'<env var: {x}>'):\n                        _parse(\n                            NamedLineIterator(os.path.join(base_path_for_includes, ''), iter(os.environ[x].splitlines())),\n                            parse_conf_item,\n                            ans,","sourceCodeStart":274,"sourceCodeEnd":310,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/conf/utils.py#L274-L310","documentation":"While parsing a kitty config file, a non-empty non-comment line did not match kitty's `key value` pattern; the line is skipped.","triggerScenarios":"Lines with no space between key and value, stray characters, or values starting before the key; key_pat.match fails.","commonSituations":"Missing space (`font_size11.0`), smart/curly quotes introduced by copy-paste from websites, or stray unicode/BOM characters at line start.","solutions":["Recheck the logged line — add the missing space between key and value","Retype the line instead of copy-pasting to kill smart quotes","Keep `key value` form: one space, ASCII"],"exampleFix":"# before\nfont_size11.0\n# after\nfont_size 11.0","handlingStrategy":"validation","validationCode":"import re\nkey_pat = re.compile(r'^([a-zA-Z0-9_]+)\\s+(.+)$')\nassert key_pat.match(line), f'bad line: {line!r}'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Retype config lines instead of copy-pasting from the web","Lint kitty.conf after edits: kitty --debug-config"],"tags":["kitty","config","parsing"],"backgroundTag":"config-line-parse-error","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}