-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DotEnv ValueError when env variable name is shorter than env_prefix #106
Comments
I realised that this also happens when extras are forbidden |
Thanks @jvllmr for reporting this 🙏 Would you mind opening a PR for fixing this? otherwise, I will fix it. |
jvllmr
pushed a commit
to jvllmr/pydantic-settings
that referenced
this issue
Jul 5, 2023
jvllmr
added a commit
to jvllmr/pydantic-settings
that referenced
this issue
Jul 5, 2023
hramezani
pushed a commit
that referenced
this issue
Jul 5, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example:
I also have another settings class that holds my general application settings.
When processing my PLATO_DEBUG env var, the following line fails:
pydantic-settings/pydantic_settings/sources.py
Line 583 in 373af71
It's because PLATO_DEBUG is shorter than the env_prefix for my DramatiqSettings class.
Possible Solution:
Check if the env var name actually starts with the env prefix before stripping the name.
Selected Assignee: @samuelcolvin
The text was updated successfully, but these errors were encountered: