dotenv_values returns an OrderedDict

Offen
#355 4 Kommentare 5 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 12 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
tooling

Rechercherichtung

Start at the dotenv_values entry point and inspect how it constructs and returns the parsed configuration. Confirm the expected mapping type from the issue example, then add or update coverage so the result is a dict rather than an OrderedDict.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

From this example the value returned by dotenv_values is supposed to be a dict, but in reality (python 3.9) the value is of type OrderedDict:

from dotenv import dotenv_values

config = dotenv_values(".env")  # config = {"USER": "foo", "EMAIL": "[email protected]"}

This is what I get:

from dotenv import dotenv_values

config = dotenv_values('.env') # config = OrderedDict([('consumer_key', '****'), ('consumer_secret', '****'), ('access_token', '****'), ('access_secret', '****')])

dict(config) # {'consumer_key': '****', 'consumer_secret': '****', 'access_token': '****', 'access_secret': '****'}

Vorherrschende Sprache
Python
Sterne
8.9k
Forks
618
Ø Merge
12 T. 6 Min.
Gemergte PRs (30 T.)
3

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus theskumar/python-dotenv

Alle Issues in theskumar/python-dotenv

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.