#13 Fix enum_type_object type on Python 3.11
Closed 2 years ago by trodgers. Opened 2 years ago by churchyard.
rpms/ churchyard/boost enum_type_object  into  rawhide

@@ -0,0 +1,35 @@ 

+ From ae5da2a7e8f1111757d8a474095486a5b22aa12d Mon Sep 17 00:00:00 2001

+ From: Victor Stinner <vstinner@python.org>

+ Date: Mon, 25 Apr 2022 10:51:46 +0200

+ Subject: [PATCH] Fix enum_type_object type on Python 3.11

+ 

+ The enum_type_object type inherits from PyLong_Type which is not tracked

+ by the GC. Instances doesn't have to be tracked by the GC: remove the

+ Py_TPFLAGS_HAVE_GC flag.

+ 

+ The Python C API documentation says:

+ 

+     "To create a container type, the tp_flags field of the type object

+     must include the Py_TPFLAGS_HAVE_GC and provide an implementation of

+     the tp_traverse handler."

+ 

+ https://docs.python.org/dev/c-api/gcsupport.html

+ 

+ The new exception was introduced in Python 3.11 by:

+ https://github.com/python/cpython/issues/88429

+ ---

+  libs/python/src/object/enum.cpp | 1 -

+  1 file changed, 1 deletion(-)

+ 

+ diff --git a/libs/python/src/object/enum.cpp b/libs/python/src/object/enum.cpp

+ index 293e705899..5753b32e07 100644

+ --- a/libs/python/src/object/enum.cpp

+ +++ b/libs/python/src/object/enum.cpp

+ @@ -113,7 +113,6 @@ static PyTypeObject enum_type_object = {

+  #if PY_VERSION_HEX < 0x03000000

+      | Py_TPFLAGS_CHECKTYPES

+  #endif

+ -    | Py_TPFLAGS_HAVE_GC

+      | Py_TPFLAGS_BASETYPE,                  /* tp_flags */

+      0,                                      /* tp_doc */

+      0,                                      /* tp_traverse */

file modified
+8 -1
@@ -42,7 +42,7 @@ 

  %global real_name boost

  Summary: The free peer-reviewed portable C++ source libraries

  Version: 1.76.0

- Release: 10%{?dist}

+ Release: 11%{?dist}

  License: Boost and MIT and Python

  

  # Replace each . with _ in %%{version}
@@ -173,6 +173,9 @@ 

  # https://github.com/boostorg/ptr_container/pull/27

  Patch105: boost-1.76.0-ptr_cont-xml.patch

  

+ # https://github.com/boostorg/python/pull/385

+ Patch106: boost-1.76.0-enum_type_object-type-python-3.11.patch

+ 

  %bcond_with tests

  %bcond_with docs_generated

  
@@ -700,6 +703,7 @@ 

  %patch103 -p2

  %patch104 -p2

  %patch105 -p1

+ %patch106 -p1

  

  %build

  %set_build_flags
@@ -1301,6 +1305,9 @@ 

  %{_mandir}/man1/b2.1*

  

  %changelog

+ * Tue Apr 26 2022 Miro Hrončok <mhroncok@redhat.com> - 1.76.0-11

+ - Fix enum_type_object type on Python 3.11

+ 

  * Thu Mar 31 2022 Jonathan Wakely <jwakely@redhat.com> - 1.76.0-10

  - Add patch to fix XML validation errors in ptr_container docs

  

no initial comment

Manually merged to rawhide

Pull-Request has been closed by trodgers

2 years ago