Support reading .env files from FIFOs (e.g. 1Password Environments)#776
Merged
hramezani merged 1 commit intopydantic:mainfrom Mar 8, 2026
Merged
Conversation
b3281f5 to
e192686
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the dotenv settings source to treat named pipes (FIFOs)—such as those used by 1Password Environments—as readable .env inputs, instead of skipping them.
Changes:
- Allow
.envpaths that are FIFOs to be read byDotEnvSettingsSource(in addition to regular files). - Add a Unix-only test that verifies
.envcontent can be read from a FIFO.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
pydantic_settings/sources/providers/dotenv.py |
Extends env file detection to include FIFO paths so mounted named pipes are read. |
tests/test_settings.py |
Adds a regression test that writes dotenv content through a FIFO and asserts it’s parsed. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
Thasnk @JacobHayes for the PR. Would be great if you can udpate the dotenv source documentation in https://github.com/pydantic/pydantic-settings/blob/main/docs/index.md#dotenv-env-support |
1Password Environments mounts .env files as named pipes (FIFOs). These were previously skipped because the is_file() check returns False for FIFOs. Add an is_fifo() check so they are read normally. Signed-off-by: Jacob Hayes <jacob.hayes@datadoghq.com>
e192686 to
38a7b56
Compare
hramezani
approved these changes
Mar 8, 2026
Member
|
Thanks @JacobHayes |
Merged
This file contains hidden or 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
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.
1Password Environments mounts
.envfiles as named pipes (FIFOs). These were previously skipped because theis_file()check returnsFalsefor FIFOs. This adds anis_fifo()check so they are read normally.https://developer.1password.com/docs/environments
Closes #771