theskumar / theskumar/python-dotenv
Avoid ending up with double quoted variables in docker.
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 8.9k
- 派生
- 581
- PR 合并指标
- 30 天内没有已合并 PR
描述
Related to the buggy way docker handles env-files
see https://github.com/docker/cli/issues/3630#issuecomment-2599705392
When you quote variables in your .env (which IHMO is a best practice):
FOO=BAR
FOO1='BAR1'
FOO2="BAR2"
and then you run docker via docker run --env-file .env
you end up with literal quoted variables inside docker:
FOO=BAR
FOO1='BAR1'
FOO2="BAR2"
This is incorrect, and should be fixed in docker.
and in python via python-dotenv, they become double quoted variables
>>> os.getenv("FOO")
'BAR'
>>> os.getenv("FOO1")
"'BAR1'"
>>> os.getenv("FOO2")
'"BAR2"'
As a work-around for the root-cause, could be avoid ending up with double-quoted variables in python?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
The issue names no repository file, test, or entry point. Reproduce the quoted .env examples with python-dotenv and compare the resulting values with the expected behavior described in the issue. Confirm the intended handling of single- and double-quoted assignments, then verify the result with an appropriate repository test or documented outcome.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- docker, python
- 领域
- devops, tooling
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100