Allow overwrite value by None if already defined
Maintainers usually reply within 12 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start at the load_dotenv entry point and trace how a later file is handled when myVar is absent versus explicitly set to an empty value. Compare the two scenarios in the issue, then verify that loading .envA removes the earlier value and returns None when myVar is not defined there.
Written by the indexing model from the issue text.
Description
I have 2 dotenv files:
Scenario1:
/var/www/flask/.envRoot <---- myVar="foo"
and
/home/userA/.envA <----------- myVar="bar"
load_dotenv(dotenv_path='/var/www/flask/.envRoot',override=True)
os.getenv('myVar') # foo
load_dotenv(dotenv_path='/home/userA/.envA',override=True)
os.getenv('myVar') # bar
Scenario2:
/var/www/flask/.envRoot <---- myVar="foo"
and
/home/userA/.envA <----------- myVar not defined
load_dotenv(dotenv_path='/var/www/flask/.envRoot',override=True)
os.getenv('myVar') # foo
load_dotenv(dotenv_path='/home/userA/.envA',override=True)
os.getenv('myVar') # foo
Scenario1 work as spected, but Scenario2 should return None if do not exist on .envA because i explicitly indicate the file to look at. But this do not happen if the key exist e.g: myVar=, only if not defined.
- Dominant language
- Python
- Stars
- 8.9k
- Forks
- 618
- Avg merge
- 12d 6m
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from theskumar/python-dotenv
-
Variable declared without a value suppresses ${VAR:-default} expansionPossibly taken @Omarinho12345 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
theskumar/python-dotenv#750 ·
Maintainers usually reply within 12 days
-
An empty value ignores ${name:-default}Possibly taken @SashaMIT claimed this 41 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
theskumar/python-dotenv#715 ·
Maintainers usually reply within 12 days
-
set_key and unset_key don't fsync before replacing the .env filePossibly taken @Imkkey claimed this 40 days ago. Openenhancement
Difficulty 3/5 1-2 days Newbie friendliness 72/100
theskumar/python-dotenv#713 ·
Maintainers usually reply within 12 days
-
Difficulty 5/5 Over a week Newbie friendliness 28/100
theskumar/python-dotenv#693 · 1 comment ·
Maintainers usually reply within 12 days
-
python-dotenv installation without cli masks python-dotenv cliPossibly taken @gyanu2507 claimed this 80 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
theskumar/python-dotenv#683 · 4 comments ·
Maintainers usually reply within 12 days
All issues in theskumar/python-dotenv
Similar issues
-
release
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
MichaelYcJo/SpecSeal#1535 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
valentinfrlch/ha-llmvision#769 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 75/100
daniel-ospina/tortoise#11937 · 1 comment ·
Maintainers usually reply within 1 day
-
good first issue help wanted python up-for-grabs
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
andrewsiah/agentswarm-data-tasks#238 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
cadence-workflow/cadence-ai-samples#175 ·
Maintainers usually reply within 1 day