You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/Users/darrenburns/code/posting/.venv/bin/posting", line 5, in <module>
from posting.__main__ import cli
File "/Users/darrenburns/code/posting/src/posting/__main__.py", line 6, in <module>
from posting.app import Posting
File "/Users/darrenburns/code/posting/src/posting/app.py", line 35, in <module>
from posting.config import Settings
File "/Users/darrenburns/code/posting/src/posting/config.py", line 45, in <module>
settings = Settings()
^^^^^^^^^^
File "/Users/darrenburns/code/posting/.venv/lib/python3.11/site-packages/pydantic_settings/main.py", line 141, in __init__
**__pydantic_self__._settings_build_values(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/darrenburns/code/posting/.venv/lib/python3.11/site-packages/pydantic_settings/main.py", line 284, in _settings_build_values
sources = self.settings_customise_sources(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/darrenburns/code/posting/src/posting/config.py", line 38, in settings_customise_sources
YamlConfigSettingsSource(settings_cls),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/darrenburns/code/posting/.venv/lib/python3.11/site-packages/pydantic_settings/sources.py", line 1673, in __init__
self.yaml_data = self._read_files(self.yaml_file_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/darrenburns/code/posting/.venv/lib/python3.11/site-packages/pydantic_settings/sources.py", line 1555, in _read_files
vars.update(self._read_file(file_path))
TypeError: 'NoneType' object is not iterable
Hi,
I'm trying to use a yaml file as a settings source, and an exception is being raised when the file contains no items.
This does not occur with the toml settings source.
Here's an example:
The file
config.yaml
is completely empty.This crashes with the following exception:
Versions:
The text was updated successfully, but these errors were encountered: