Comments (7)
Thanks @slingshotvfx for reporting.
Is it happening on Windows?
from pydantic-settings.
On Windows 11 in Python 3.12.1
I misspoke actually, this is a regression maybe all the way back to v2.2.0
from pydantic-settings.
Thanks for your quick response @slingshotvfx .
my question is why do you enable the case_sensitive
in your model. as you said you are using windows and this config doesn't have any effect on windows:
from the doc:
On Windows, Python's os module always treats environment variables as case-insensitive, so the case_sensitive config setting will have no effect - settings will always be updated ignoring case.
from pydantic-settings.
Our code is cross-platform and we utilize case_sensitive
for our Linux deployments. I admit having case_sensitive=True
in windows code is misleading if it really does nothing, but ideally it would still work and not throw a validation error.
from pydantic-settings.
One solution would be to set case_sensitive=False
when pydantic-settings
in on Windows
.
But you can do it on your side as well. like
case_sensitive=False if sys.platform.startswith('win') else True,
from pydantic-settings.
I suppose that would work. The docs are a bit misleading though, since the case_sensitive config setting will have no effect
implies that it doesn't matter if it's True
or False
and yet the behavior does change on windows when it's set to True
.
I actually bumped into this while troubleshooting #420, but I'm realizing now that that issue is unrelated and I think this issue is just a duplicate of #295 rather than a regression. Apologies for the confusion.
from pydantic-settings.
No worries, let's mark this one as duplicate and close.
from pydantic-settings.
Related Issues (20)
- Mypy reports error when passing a list to YamlConfigSettingsSource through yaml_file HOT 1
- Mypy plugin reports false positives and not existing lines HOT 1
- Ignore unknown sys.argv HOT 5
- Support dash-separated CLI arguments and underscore-separated ENV variables HOT 4
- context not passed to field validators HOT 4
- Order of alias given in AliasChoices yield different results HOT 3
- add an option to not validate a model if all configuration options it contains are empty HOT 2
- reconsider adding Singleton option for BaseSettings HOT 4
- AzureKeyVaultSettingsSource ignoring SettingsSource Priority HOT 3
- PyprojectTomlConfigSettingsSource overwrite `toml_file` Path from `model_config` HOT 2
- Feature: Make argument flag configurable HOT 5
- support regex to load config that falls under the same roof HOT 2
- Regression - .env nested optional model support HOT 4
- Add SOPS settings source for secrets HOT 1
- pydantic-settings new version can't handle scenario HOT 2
- Allow to load a settings without validation HOT 3
- nested_model_default_partial_update documentation isn't clear
- env_prefix Ignored in Some Cases in Pydantic Settings
- Separate tests related to specific settings sources
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pydantic-settings.