theskumar / theskumar/python-dotenv

Avoid ending up with double quoted variables in docker.

Aperta
#545 0 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

Related to the buggy way docker handles env-files
see https://github.com/docker/cli/issues/3630#issuecomment-2599705392

When you quote variables in your .env (which IHMO is a best practice):

FOO=BAR
FOO1='BAR1'
FOO2="BAR2"

and then you run docker via docker run --env-file .env
you end up with literal quoted variables inside docker:

FOO=BAR
FOO1='BAR1'
FOO2="BAR2"

This is incorrect, and should be fixed in docker.

and in python via python-dotenv, they become double quoted variables


>>> os.getenv("FOO")
'BAR'

>>> os.getenv("FOO1")
"'BAR1'"

>>> os.getenv("FOO2")
'"BAR2"'

As a work-around for the root-cause, could be avoid ending up with double-quoted variables in python?

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

The issue names no repository file, test, or entry point. Reproduce the quoted .env examples with python-dotenv and compare the resulting values with the expected behavior described in the issue. Confirm the intended handling of single- and double-quoted assignments, then verify the result with an appropriate repository test or documented outcome.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.