-
-
Notifications
You must be signed in to change notification settings - Fork 978
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
Raise FileNotFoundError
when the env_file
parameter on Config
is not valid
#2422
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Kludex
approved these changes
Jan 20, 2024
FileNotFoundError
when env file is missing on Config
FileNotFoundError
when env file is missing on Config
FileNotFoundError
when env_file
is missing on Config
FileNotFoundError
when env_file
is missing on Config
FileNotFoundError
when the env_file
parameter on Config
is not valid
WilliamDEdwards
added a commit
to CyberfusionIO/python3-cyberfusion-security-txt-policy-server
that referenced
this pull request
Jan 22, 2024
37 tasks
oof, all my docker containers using the old documented pattern are now failing after routine dependency updates. |
PeterJCLaw
added a commit
to PeterJCLaw/code-submitter
that referenced
this pull request
Feb 5, 2024
Changed in: encode/starlette#2422, though not called out as breaking in the release notes.
3 tasks
nixroxursox
pushed a commit
to nixroxursox/starlette
that referenced
this pull request
Mar 18, 2024
…s not valid (encode#2422) * raise error on missing env file * format --------- Co-authored-by: Marcelo Trylesinski <[email protected]>
br3ndonland
added a commit
to br3ndonland/fastenv
that referenced
this pull request
Apr 7, 2024
Starlette 0.37 modifies the exception handling behavior of the `Config` class used for application settings. The `Config` class accepts an `env_file` arg that can be used to load environment variables from a "dotenv" (`.env`) file. Previously, if the file was not found, the `Config` class would silently pass without any exception. In 0.36, the `Config` class was updated to raise a `FileNotFoundError` exception if `env_file` was not not found. This was a breaking change but was not documented as such (encode/starlette#2422, encode/starlette#2446). In 0.37, the exception handling behavior has been changed again to raise a warning instead of an exception (encode/starlette#2485), which could also be a breaking change if users had rewritten their code to catch the `FileNotFoundError`. This commit will update the comparisons docs to explain that a warning will now be raised, and will link to the relevant code changes.
br3ndonland
added a commit
to br3ndonland/inboard
that referenced
this pull request
Apr 8, 2024
This commit will update/upgrade to [FastAPI 0.110.1](https://fastapi.tiangolo.com/release-notes/) and [Starlette 0.37.2](https://www.starlette.io/release-notes/). FastAPI 0.110 makes a change to dependencies with `yield` and `except`. Dependencies must now raise exceptions after `except`. This change is intended to address memory leak issues and may be a breaking change in some projects if dependencies with `yield` and `except` used `pass` instead of `raise`. See the [FastAPI docs](https://fastapi.tiangolo.com/tutorial/dependencies/dependencies-with-yield/) for further info. FastAPI 0.110.1 makes a small type annotation change to the `Depends` dependency class. Starlette 0.37 modifies the exception handling behavior of the `Config` class used for application settings. The `Config` class accepts an `env_file` arg that can be used to load environment variables from a "dotenv" (`.env`) file. Previously, if the file was not found, the `Config` class would silently pass without any exception. In 0.36, the `Config` class was updated to raise a `FileNotFoundError` exception if `env_file` was not not found. This was a breaking change but was not documented as such (encode/starlette#2422, encode/starlette#2446). In 0.37, the exception handling behavior has been changed again to raise a warning instead of an exception (encode/starlette#2485), which could also be a breaking change if users had rewritten their code to catch the `FileNotFoundError`. See the [fastenv docs](https://fastenv.bws.bio/comparisons#starlette) for a detailed description of the Starlette `Config` class. Note that FastAPI updated the Starlette minor version from 0.36 to 0.37 in the 0.110.1 patch release.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Addresses #2101
Checklist
-> I think this if ok without doc update. Let me know otherwise.