Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Environment values containing '=' are truncated in --extra-docker-config

未關閉
#679 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

@Amadeus-22 已經在處理了。

開始於 2026年10月19日。

  • #680 來自 @Amadeus-22 —— 未關閉

評估

難度
1/5
預估耗時
1-3 小時
新手友好度
1/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
python
領域
cli

研究方向

Start in lean/components/docker/lean_runner.py at LeanRunner.parse_extra_docker_config around line 972, then inspect its callers to understand how environment entries are passed through. Reproduce the truncation with the Python snippet in the issue; done means values containing = reach the container unchanged across the listed commands, with a regression test covering the examples. A linked open pull request (#680) is already addressing this issue.

由索引模型根據 Issue 內容生成。

描述

Expected Behavior

environment entries passed as KEY=VALUE strings in --extra-docker-config are split on the first = only, like Docker does, so values that contain = reach the container unchanged:

lean backtest MyProject --extra-docker-config '{"environment": ["JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8", "TOKEN=abc=="]}'
# container env: JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8, TOKEN=abc==
Actual Behavior

LeanRunner.parse_extra_docker_config splits on every = and keeps only the first two parts, so everything after the second = is silently dropped:

{"JAVA_TOOL_OPTIONS": "-Dfile.encoding", "TOKEN": "abc"}

This breaks JVM -D options, base64 tokens and connection strings passed this way. It affects backtest, live, research, optimize and private-cloud start.

Potential Solution

Use item.split("=", 1) in lean/components/docker/lean_runner.py (line 972). I can open a PR with the fix and a test.

Reproducing the Problem
from lean.components.docker.lean_runner import LeanRunner
run_options = {}
LeanRunner.parse_extra_docker_config(run_options, {"environment": ["JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8", "TOKEN=abc=="]})
print(run_options["environment"])
System Information

lean-cli master at b4d724c, Python 3.12, Linux.

Checklist
  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
主要語言
Python
星號
329
分支
170
平均合併
8 天 14 小時
30 天內合併 PR
7

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

QuantConnect/lean-cli 的其他 Issue

查看 QuantConnect/lean-cli 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。