theskumar / theskumar/python-dotenv

Bug: python-dotenv doesn't load 1Password “mounted” .env files (looks like a FIFO / fd-backed file)

Aperta
#598 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Python
Stelle
8.9k
Fork
581
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I’ve been trying 1Password’s new environment feature which mounts a .env file to a destination path (I think it’s a pipe, file descriptor path, or some other non-regular file). This seems to be a Mac feature right now.

python-dotenv doesn’t seem to load anything from it, even though the path exists.

What I expected

load_dotenv() (or dotenv_values()) should read key/value pairs from the mounted .env file, same as a normal file. I'd expect something similar to Node's dotenv package, that when the file tries to be read, 1Password prompts you to allow access. Only then are the values available

What happened instead

The file path exists, but reading it gives an empty string (and python-dotenv ends up loading nothing).

Quick sanity check:

from pathlib import Path

p = Path(".env")
print("exists:", p.exists())
print("readable:", p.read_text(errors="replace"))

Output:

exists: True
readable:
Repro steps
  1. Use 1Password to mount / expose a .env file (however their new environment feature does it).
  2. Point the app at that .env path (eg in the project root as .env).
  3. Call load_dotenv() or dotenv_values().
  4. Observe that nothing is loaded.
Versions
  • OS: macOS 15.6
  • Python: 3.13
  • python-dotenv: 1.0.1
  • 1Password + CLI: 8.11.22

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Start by reproducing the mounted .env behavior with the named load_dotenv() and dotenv_values() entry points on macOS. Trace how they open and read the supplied path, then verify completion by confirming that key/value pairs from the 1Password-mounted file are loaded rather than an empty string.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.