Flurry of error messages in validation log that have nothing to do with my YAML. Errors regarding ESPHome Python files

Normally, when I try to validate my YAML for a new ESPHome device, I’ll run into an inevitable syntax error or something, fix it till it works, and then install the YAML on my ESP32 device. Today, something new has happened, and the validation fails repeatedly with the same error messages (this has persisted through a reboot, in case that might help). The error messages all refer to Python files that do the actually YAML validation. I have no clue how to fix this one. Reinstall ESPHome? If anyone has some suggestions on how to fix the issue, I’d love to hear your thoughts. Full log detail below:

INFO ESPHome 2025.3.3
INFO Reading configuration /config/esphome/esphome-web-f71094.yaml...
ERROR Unexpected exception while reading configuration:
Traceback (most recent call last):
  File "/usr/local/bin/esphome", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/esphome/esphome/__main__.py", line 1057, in main
    return run_esphome(sys.argv)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 1035, in run_esphome
    config = read_config(dict(args.substitution) if args.substitution else {})
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/config.py", line 1095, in read_config
    res = load_config(command_line_substitutions)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/config.py", line 949, in load_config
    return _load_config(command_line_substitutions)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/config.py", line 939, in _load_config
    return validate_config(config, command_line_substitutions)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/config.py", line 863, in validate_config
    result.run_validation_steps()
  File "/esphome/esphome/config.py", line 142, in run_validation_steps
    task.step.run(self)
  File "/esphome/esphome/config.py", line 562, in run
    validated = schema(self.conf)
                ^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/voluptuous_schema.py", line 35, in __call__
    res = super().__call__(data)
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/voluptuous/schema_builder.py", line 281, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/voluptuous/validators.py", line 251, in _run
    return self._exec(self._compiled, value, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/voluptuous/validators.py", line 379, in _exec
    v = func(path, v)
        ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/voluptuous/schema_builder.py", line 855, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/esphome/esphome/voluptuous_schema.py", line 35, in __call__
    res = super().__call__(data)
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/voluptuous/schema_builder.py", line 281, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/voluptuous/schema_builder.py", line 625, in validate_dict
    return base_validate(path, data.items(), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/voluptuous_schema.py", line 149, in validate_mapping
    cval = cvalue(key_path, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/voluptuous/schema_builder.py", line 855, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/esphome/esphome/components/font/__init__.py", line 424, in font_file_schema
    return validate_file_shorthand(value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/components/font/__init__.py", line 405, in validate_file_shorthand
    return font_file_schema(
           ^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/components/font/__init__.py", line 425, in font_file_schema
    return TYPED_FILE_SCHEMA(value)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/config_validation.py", line 1630, in validator
    value = Schema(schemas[key_v])(value)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/voluptuous_schema.py", line 35, in __call__
    res = super().__call__(data)
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/voluptuous/schema_builder.py", line 281, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/voluptuous/validators.py", line 251, in _run
    return self._exec(self._compiled, value, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/voluptuous/validators.py", line 379, in _exec
    v = func(path, v)
        ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/voluptuous/schema_builder.py", line 855, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/esphome/esphome/components/font/__init__.py", line 253, in add_local_file
    FONT_CACHE[value] = path
    ~~~~~~~~~~^^^^^^^
  File "/esphome/esphome/components/font/__init__.py", line 96, in __setitem__
    self.store[self._keytransform(key)] = Face(str(value))
                                          ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/freetype/__init__.py", line 1192, in __init__
    raise FT_Exception(error)
freetype.ft_errors.FT_Exception: FT_Exception:  (unknown file format)

Did you create the file on a windows PC?

It might have line feed carriage return line ends (Windows) instead of just line feed (Linux).

config/esphome/esphome-web-f71094.yaml

It doesn’t like that file. What is in that file?

That is a nasty looking error, but there is likely something in the file that is REALLY confusing the syntax checker so it throws up its hands and says “it is BAD”.