Skip to content

Conversation

@sidharth-sudhir
Copy link

@sidharth-sudhir sidharth-sudhir commented Oct 21, 2025

Summary

Adds support for .env files provided via Unix FIFOs (named pipes).

Rationale

1Password recently launched local .env file support, which allows developers to securely access secrets stored in 1Password Environments via a local .env file that is actually a UNIX named pipe (FIFO). This lets secrets be streamed directly into processes without ever writing plaintext credentials to disk.

Currently, Python’s python-dotenv library cannot read such mounted .env files because it only recognizes regular files. This PR adds native FIFO (named pipe) support so that Python developers can seamlessly use python-dotenv with 1Password’s new .env destinations.

We’d love for python-dotenv to achieve feature parity with other language ecosystems already supported, see the compatibility table here, and make Python’s developer experience consistent with tools like Node.js dotenv, Go’s godotenv, and others.

Changes

  • In _get_stream and find_dotenv, consider a path readable if it is a regular file or a FIFO using stat.S_ISFIFO(os.stat(path).st_mode).
  • No behavioural change for regular files.

Tests

  • Adds tests/test_fifo_dotenv.py (skipped on Windows) that creates a FIFO, writes a value, and verifies load_dotenv loads it.

Notes

  • Unix/macOS only (Windows named pipes not covered).

Disclosure

I work at 1Password and am contributing this change to improve compatibility between 1Password Environments and python-dotenv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant