theskumar / theskumar/python-dotenv

dotenv_values returns an OrderedDict

Open
#355 4 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.9k
Forks
581
PR merge metrics
No merged PRs in 30d

Description

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": "foo@example.org"}

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': '****'}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

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.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.