boostorg / boostorg/python

Python 3.11 gives SystemError: type Boost.Python.enum has the Py_TPFLAGS_HAVE_GC flag but has no traverse function

未关闭
#400 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C++
星标
537
派生
223
平均合并
11 小时 22 分钟
30 天内合并 PR
2

描述

Up to Python 3.10 our Boost Python binding ran fine.
As of Python 3.11 we get the following error upon import of the binding;

`SystemError: type Boost.Python.enum has the Py_TPFLAGS_HAVE_GC flag but has no traverse function`

Running;
Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] on win32
boost_1_80_0
b2 -j%NUMBER_OF_PROCESSORS% python=3.11 --with-python --stage-libdir=lib64-msvc-14.3 --build-type=complete toolset=msvc-14.3 address-model=64 architecture=x86 debug-symbols=on stage

If I remove line 116 of libs\python\src\object\enum.cpp I don't get the error.

```

#if PY_VERSION_HEX < 0x03000000
| Py_TPFLAGS_CHECKTYPES
#endif
| Py_TPFLAGS_HAVE_GC /* <============== remove this line */
| Py_TPFLAGS_BASETYPE, /* tp_flags */

```

Is it safe to do this?

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。