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
$ D__X='["baz"]' python -m config_env_null
Traceback (most recent call last):
File "/Users/mlw/.pyenv/versions/3.9.14/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Users/mlw/.pyenv/versions/3.9.14/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/mlw/tmp/pydantic/t.py", line 17, in<module>
c = C()
File "pydantic/env_settings.py", line 39, in pydantic.env_settings.BaseSettings.__init__
File "pydantic/main.py", line 342, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for C
d -> x
value is not a valid list (type=type_error.list)
Is this what the docs are suggesting, or do they mean something else? (And would you take a PR to clarify this bit of the docs, or would you rather not encourage these kinds of hacks while gearing up for v2, etc.)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
With this code
this works fine
but this fails (note environment variable):
I asssume this is for the reason mentioned in the docs, i.e.
That's fine. My question is about the solution suggested in the rest of the sentence, which is described extremely tersely:
This is my guess at what it means.
Is this what the docs are suggesting, or do they mean something else? (And would you take a PR to clarify this bit of the docs, or would you rather not encourage these kinds of hacks while gearing up for v2, etc.)
Beta Was this translation helpful? Give feedback.
All reactions