Giter Club home page Giter Club logo

Comments (7)

hramezani avatar hramezani commented on September 28, 2024

Thanks @slingshotvfx for reporting.

Is it happening on Windows?

from pydantic-settings.

slingshotvfx avatar slingshotvfx commented on September 28, 2024

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.

hramezani avatar hramezani commented on September 28, 2024

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.

slingshotvfx avatar slingshotvfx commented on September 28, 2024

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.

hramezani avatar hramezani commented on September 28, 2024

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.

slingshotvfx avatar slingshotvfx commented on September 28, 2024

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.

hramezani avatar hramezani commented on September 28, 2024

No worries, let's mark this one as duplicate and close.

from pydantic-settings.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.