Do you plan to call os.path.expandvars?
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start in src/dotenv/main.py around line 98 and trace how values from .env files are expanded. Check how Windows-style variables and recursive references should behave, then verify the LOG_DIR and TRACE_LOG_DIR examples resolve as requested. No linked tests or further maintainer guidance are provided.
由索引模型根据 Issue 内容生成。
描述
I request to be able to fill in the environment variable name by calling os.path.environmentvars when setting the value in main.py#L98.
An environment variable name is, for example, %TEMP% (in Windows).
[.env]
LOG_DIR=%TEMP%\log
If possible, it would be nice if it could be called recursively. os.path.expandvars will only expand the environment variable name once.
def expandvarsRecursive(value):.
expanded = os.path.expandvars(value)
return value if expanded == value else expandvarsRecursive(expanded)
The reason for this is that if it is called recursively, we don't have to keep track of the same values.
[.env]
PROJECT_HOME=C:\project
LOG_DIR=%PROJECT_HOME%\log
TRACE_LOG_DIR=%LOG_DIR%\trace
Please consider this.
- 主要语言
- Python
- 星标
- 8.9k
- 派生
- 585
- 平均合并
- 8 天 8 小时
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
theskumar/python-dotenv 的其他 Issue
-
An empty value ignores ${name:-default}可能已有人在做 @SashaMIT 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
theskumar/python-dotenv#715 ·
维护者通常 1 天内回复
-
set_key and unset_key don't fsync before replacing the .env file可能已有人在做 @Imkkey 于 2 天前认领。 未关闭enhancement
难度 3/5 1-2 天 新手友好度 72/100
theskumar/python-dotenv#713 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 28/100
theskumar/python-dotenv#693 · 1 条评论 ·
维护者通常 1 天内回复
-
python-dotenv installation without cli masks python-dotenv cli可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 1-2 天 新手友好度 55/100
theskumar/python-dotenv#683 · 4 条评论 ·
维护者通常 1 天内回复
-
Feature Request: Automatically copy `default.env` to `.env`可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 1-2 天 新手友好度 55/100
theskumar/python-dotenv#644 · 2 条评论 ·
维护者通常 1 天内回复
查看 theskumar/python-dotenv 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
FuRongJun-1999/dsh-memory#56 ·
维护者通常 1 天内回复
-
Bug
难度 2/5 1-3 小时 新手友好度 76/100
pgadmin-org/pgadmin4#10503 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
521xueweihan/HelloGitHub#3857 ·
-
documentation
难度 2/5 1-3 小时 新手友好度 74/100
rai-opensource/spatialmath-python#235 ·
维护者通常 1 天内回复
-
needs-ac
难度 2/5 1-3 小时 新手友好度 78/100
Ikalus1988/MisakaNet#2845 ·
维护者通常 1 天内回复