Skip to content

Python 3.12: error: PyLongObject {aka struct _longobject} has no member named ob_digit #2720

@vkrizan

Description

@vkrizan

Peewee fails to build with Python 3.12.0a7.

  playhouse/_sqlite_udf.c: In function ‘__Pyx_PyInt_AddObjC’:
  playhouse/_sqlite_udf.c:5604:51: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
   5604 |         const digit* digits = ((PyLongObject*)op1)->ob_digit;
        |                                                   ^~
  playhouse/_sqlite_udf.c: In function ‘__Pyx_PyUnicode_Equals’:
  playhouse/_sqlite_udf.c:569:51: warning: implicit declaration of function ‘_PyUnicode_Ready’; did you mean ‘PyUnicode_READY’? [-Wimplicit-function-declaration]
    569 |                                               0 : _PyUnicode_Ready((PyObject *)(op)))
        |                                                   ^~~~~~~~~~~~~~~~
  playhouse/_sqlite_udf.c:944:43: note: in definition of macro ‘unlikely’
    944 |   #define unlikely(x) __builtin_expect(!!(x), 0)
        |                                           ^
  playhouse/_sqlite_udf.c:6097:22: note: in expansion of macro ‘__Pyx_PyUnicode_READY’
   6097 |         if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
        |                      ^~~~~~~~~~~~~~~~~~~~~
  playhouse/_sqlite_udf.c: In function ‘__Pyx_Raise’:
  playhouse/_sqlite_udf.c:6584:34: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_traceback’
   6584 |         PyObject* tmp_tb = tstate->curexc_traceback;
        |                                  ^~
  playhouse/_sqlite_udf.c:6587:19: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_traceback’
   6587 |             tstate->curexc_traceback = tb;
        |                   ^~
  playhouse/_sqlite_udf.c: In function ‘__Pyx_PyInt_EqObjC’:
  playhouse/_sqlite_udf.c:6827:51: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
   6827 |         const digit* digits = ((PyLongObject*)op1)->ob_digit;
        |                                                   ^~
  playhouse/_sqlite_udf.c: In function ‘__Pyx_CLineForTraceback’:
  playhouse/_sqlite_udf.c:6892:9: warning: ‘ma_version_tag’ is deprecated [-Wdeprecated-declarations]
   6892 |         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/python3.12/cpython/dictobject.h:22:34: note: declared here
     22 |     Py_DEPRECATED(3.12) uint64_t ma_version_tag;
        |                                  ^~~~~~~~~~~~~~
  playhouse/_sqlite_udf.c:6892:9: warning: ‘ma_version_tag’ is deprecated [-Wdeprecated-declarations]
   6892 |         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/python3.12/cpython/dictobject.h:22:34: note: declared here
     22 |     Py_DEPRECATED(3.12) uint64_t ma_version_tag;
        |                                  ^~~~~~~~~~~~~~
  playhouse/_sqlite_udf.c: In function ‘__Pyx_PyInt_As_int’:
  playhouse/_sqlite_udf.c:7193:53: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
   7193 |             const digit* digits = ((PyLongObject*)x)->ob_digit;
        |                                                     ^~
  playhouse/_sqlite_udf.c:7248:53: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
   7248 |             const digit* digits = ((PyLongObject*)x)->ob_digit;
        |                                                     ^~
  playhouse/_sqlite_udf.c: In function ‘__Pyx_PyInt_As_long’:
  playhouse/_sqlite_udf.c:7427:53: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
   7427 |             const digit* digits = ((PyLongObject*)x)->ob_digit;
        |                                                     ^~
  playhouse/_sqlite_udf.c:7482:53: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
   7482 |             const digit* digits = ((PyLongObject*)x)->ob_digit;
        |                                                     ^~
  playhouse/_sqlite_udf.c: In function ‘__Pyx_PyIndex_AsSsize_t’:
  playhouse/_sqlite_udf.c:7933:45: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
   7933 |     const digit* digits = ((PyLongObject*)b)->ob_digit;
        |                                             ^~

GH-101291: Refactor the PyLongObject struct #101292
python/cpython#101292
https://docs.python.org/3.12/whatsnew/3.12.html

Ref: https://bugzilla.redhat.com/show_bug.cgi?id=2192872

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions