Clarify the situation with the memory allocation for `PyConfig.home`
未关闭
还没有人认领这个 Issue。
docs
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 36k
- PR 合并指标
- PR 指标待抓取
描述
Documentation
https://docs.python.org/3/c-api/init_config.html#c.PyConfig.home
Empirically, it seems that CPython expects this value to be allocated with malloc() as it will try to free() it when finalizing the environment. This is in stark contrast to the now deprecated Py_SetPythonHome which expected that the value is statically allocated.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 C API 初始化配置文档中的 PyConfig.home 条目开始,将其中说明的所有权规则与已弃用的 Py_SetPythonHome 行为进行比较。确认该值是否必须使用 malloc() 分配并由 CPython 释放,然后更新文档,清楚说明所需的分配方式和生命周期。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- documentation
- Issue 类型
- 文档
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100