Allow overwrite value by None if already defined
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 8.9k
- Fork
- 581
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của theskumar/python-dotenv
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
theskumar/python-dotenv#699 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
theskumar/python-dotenv#697 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
theskumar/python-dotenv#693 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
theskumar/python-dotenv#683 · 4 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
theskumar/python-dotenv#644 · 2 bình luận ·
Tất cả issue của theskumar/python-dotenv
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
zostera/django-bootstrap4#894 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
use-agent-os/agent-os#3276 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
NousResearch/hermes-agent#117848 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
zilliztech/memsearch#759 ·