boostorg / boostorg/python

exec_file fails completely on Python 3.1 and above

未關閉
#371 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
C++
星號
537
分支
223
平均合併
11 小時 22 分鐘
30 天內合併 PR
2

描述

When PY_VERSION_HEX >= 0x03010000, boost::python::exec_file passes an invalid string to Py_RunFile.

The problem is that char* f points to a temporary buffer returned by the UTF conversion routine PyBytes_AsString, but this buffer is deallocated via Py_DECREF before f gets passed to Py_RunFile.

I will create a pull request with a fix shortly.

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

定位 boost::python::exec_file 的實作,並沿著 PY_VERSION_HEX >= 0x03010000 路徑追蹤 PyBytes_AsString 和 Py_RunFile。確認 Py_RunFile 接收緩衝區時緩衝區仍然有效,然後在 Python 3.1 或更新版本上執行 exec_file,並驗證檔案能夠成功執行。

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

評估

技術堆疊
cpp, python
領域
backend
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
48/100

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

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