python 3 support

Bug #1943920 reported by OK1ASW
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Undecided
Unassigned

Bug Description

I'm trying to build the version 2.7.0 from source. When I run `python setup.py install`, it shows this error:

In file included from bzrlib/_static_tuple_c.h:84,
                 from bzrlib/_bencode_pyx.c:244:
bzrlib/_import_c_api.h: In function ‘_import_function’:
bzrlib/_import_c_api.h:66:20: warning: implicit declaration of function ‘PyCObject_GetDesc’; did you mean ‘PyObject_GetIter’? [-Wimplicit-function-declaration]
   66 | desc = (char *)PyCObject_GetDesc(c_obj);
      | ^~~~~~~~~~~~~~~~~
      | PyObject_GetIter
bzrlib/_import_c_api.h:66:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   66 | desc = (char *)PyCObject_GetDesc(c_obj);
      | ^
bzrlib/_import_c_api.h:76:13: warning: implicit declaration of function ‘PyCObject_AsVoidPtr’; did you mean ‘PyLong_AsVoidPtr’? [-Wimplicit-function-declaration]
   76 | *func = PyCObject_AsVoidPtr(c_obj);
      | ^~~~~~~~~~~~~~~~~~~
      | PyLong_AsVoidPtr
bzrlib/_import_c_api.h:76:11: warning: assignment to ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
   76 | *func = PyCObject_AsVoidPtr(c_obj);
      | ^
bzrlib/_bencode_pyx.c: In function ‘__pyx_pf_6bzrlib_12_bencode_pyx_7Decoder___init__’:
bzrlib/_bencode_pyx.c:1143:15: warning: implicit declaration of function ‘PyString_AS_STRING’; did you mean ‘PyBytes_AS_STRING’? [-Wimplicit-function-declaration]
 1143 | __pyx_t_3 = PyString_AS_STRING(__pyx_v_s); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      | ^~~~~~~~~~~~~~~~~~
      | PyBytes_AS_STRING
bzrlib/_bencode_pyx.c:1143:13: warning: assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
 1143 | __pyx_t_3 = PyString_AS_STRING(__pyx_v_s); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      | ^
bzrlib/_bencode_pyx.c:1153:15: warning: implicit declaration of function ‘PyString_GET_SIZE’; did you mean ‘PyList_GET_SIZE’? [-Wimplicit-function-declaration]
 1153 | __pyx_t_4 = PyString_GET_SIZE(__pyx_v_s); if (unlikely(__pyx_t_4 == -1L)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      | ^~~~~~~~~~~~~~~~~
      | PyList_GET_SIZE
bzrlib/_bencode_pyx.c: In function ‘__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_string’:
bzrlib/_bencode_pyx.c:2419:15: warning: implicit declaration of function ‘PyString_FromStringAndSize’; did you mean ‘PyBytes_FromStringAndSize’? [-Wimplicit-function-declaration]
 2419 | __pyx_t_4 = PyString_FromStringAndSize(__pyx_v_self->tail, __pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
      | PyBytes_FromStringAndSize
bzrlib/_bencode_pyx.c:2419:13: warning: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
 2419 | __pyx_t_4 = PyString_FromStringAndSize(__pyx_v_self->tail, __pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      | ^
bzrlib/_bencode_pyx.c: In function ‘__pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_4__str__’:
bzrlib/_bencode_pyx.c:3657:15: warning: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
 3657 | __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_self->buffer, __pyx_v_self->size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      | ^
bzrlib/_bencode_pyx.c: In function ‘__pyx_f_6bzrlib_12_bencode_pyx_7Encoder__append_string’:
bzrlib/_bencode_pyx.c:4120:13: warning: assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
 4120 | __pyx_t_3 = PyString_AS_STRING(__pyx_v_s); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      | ^
bzrlib/_bencode_pyx.c: In function ‘__pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_string’:
bzrlib/_bencode_pyx.c:4258:13: warning: assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
 4258 | __pyx_t_6 = PyString_AS_STRING(__pyx_v_x); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      | ^
bzrlib/_bencode_pyx.c: In function ‘PyInit__bencode_pyx’:
bzrlib/_bencode_pyx.c:6223:44: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
 6223 | __pyx_type_6bzrlib_12_bencode_pyx_Decoder.tp_print = 0;
      | ^
bzrlib/_bencode_pyx.c:6246:44: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
 6246 | __pyx_type_6bzrlib_12_bencode_pyx_Encoder.tp_print = 0;
      | ^
bzrlib/_bencode_pyx.c: In function ‘__Pyx_ParseOptionalKeywords’:
bzrlib/_bencode_pyx.c:6508:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
 6508 | (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
      | ^
In file included from /usr/include/python3.9/unicodeobject.h:1026,
                 from /usr/include/python3.9/Python.h:106,
                 from bzrlib/_bencode_pyx.c:4:
/usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
  446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
bzrlib/_bencode_pyx.c:6508:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
 6508 | (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
      | ^
In file included from /usr/include/python3.9/unicodeobject.h:1026,
                 from /usr/include/python3.9/Python.h:106,
                 from bzrlib/_bencode_pyx.c:4:
/usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
  580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
      | ^~~~~~~~~~~~~~~~~~~
bzrlib/_bencode_pyx.c:6508:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
 6508 | (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
      | ^
In file included from /usr/include/python3.9/unicodeobject.h:1026,
                 from /usr/include/python3.9/Python.h:106,
                 from bzrlib/_bencode_pyx.c:4:
/usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
  446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
bzrlib/_bencode_pyx.c:6508:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
 6508 | (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
      | ^
In file included from /usr/include/python3.9/unicodeobject.h:1026,
                 from /usr/include/python3.9/Python.h:106,
                 from bzrlib/_bencode_pyx.c:4:
/usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
  446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
bzrlib/_bencode_pyx.c:6508:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
 6508 | (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
      | ^
In file included from /usr/include/python3.9/unicodeobject.h:1026,
                 from /usr/include/python3.9/Python.h:106,
                 from bzrlib/_bencode_pyx.c:4:
/usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
  580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
      | ^~~~~~~~~~~~~~~~~~~
bzrlib/_bencode_pyx.c:6508:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
 6508 | (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
      | ^
In file included from /usr/include/python3.9/unicodeobject.h:1026,
                 from /usr/include/python3.9/Python.h:106,
                 from bzrlib/_bencode_pyx.c:4:
/usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
  446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
bzrlib/_bencode_pyx.c:6524:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
 6524 | (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
      | ^
In file included from /usr/include/python3.9/unicodeobject.h:1026,
                 from /usr/include/python3.9/Python.h:106,
                 from bzrlib/_bencode_pyx.c:4:
/usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
  446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
bzrlib/_bencode_pyx.c:6524:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
 6524 | (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
      | ^
In file included from /usr/include/python3.9/unicodeobject.h:1026,
                 from /usr/include/python3.9/Python.h:106,
                 from bzrlib/_bencode_pyx.c:4:
/usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
  580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
      | ^~~~~~~~~~~~~~~~~~~
bzrlib/_bencode_pyx.c:6524:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
 6524 | (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
      | ^
In file included from /usr/include/python3.9/unicodeobject.h:1026,
                 from /usr/include/python3.9/Python.h:106,
                 from bzrlib/_bencode_pyx.c:4:
/usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
  446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
bzrlib/_bencode_pyx.c:6524:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
 6524 | (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
      | ^
In file included from /usr/include/python3.9/unicodeobject.h:1026,
                 from /usr/include/python3.9/Python.h:106,
                 from bzrlib/_bencode_pyx.c:4:
/usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
  446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
bzrlib/_bencode_pyx.c:6524:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
 6524 | (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
      | ^
In file included from /usr/include/python3.9/unicodeobject.h:1026,
                 from /usr/include/python3.9/Python.h:106,
                 from bzrlib/_bencode_pyx.c:4:
/usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
  580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
      | ^~~~~~~~~~~~~~~~~~~
bzrlib/_bencode_pyx.c:6524:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
 6524 | (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
      | ^
In file included from /usr/include/python3.9/unicodeobject.h:1026,
                 from /usr/include/python3.9/Python.h:106,
                 from bzrlib/_bencode_pyx.c:4:
/usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
  446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
bzrlib/_bencode_pyx.c: In function ‘__Pyx_GetException’:
bzrlib/_bencode_pyx.c:6830:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
 6830 | tmp_type = tstate->exc_type;
      | ^~~~~~~~
      | curexc_type
bzrlib/_bencode_pyx.c:6831:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
 6831 | tmp_value = tstate->exc_value;
      | ^~~~~~~~~
      | curexc_value
bzrlib/_bencode_pyx.c:6832:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
 6832 | tmp_tb = tstate->exc_traceback;
      | ^~~~~~~~~~~~~
      | curexc_traceback
bzrlib/_bencode_pyx.c:6833:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
 6833 | tstate->exc_type = local_type;
      | ^~~~~~~~
      | curexc_type
bzrlib/_bencode_pyx.c:6834:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
 6834 | tstate->exc_value = local_value;
      | ^~~~~~~~~
      | curexc_value
bzrlib/_bencode_pyx.c:6835:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
 6835 | tstate->exc_traceback = local_tb;
      | ^~~~~~~~~~~~~
      | curexc_traceback
bzrlib/_bencode_pyx.c: In function ‘__Pyx_ExceptionSwap’:
bzrlib/_bencode_pyx.c:6857:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
 6857 | tmp_type = tstate->exc_type;
      | ^~~~~~~~
      | curexc_type
bzrlib/_bencode_pyx.c:6858:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
 6858 | tmp_value = tstate->exc_value;
      | ^~~~~~~~~
      | curexc_value
bzrlib/_bencode_pyx.c:6859:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
 6859 | tmp_tb = tstate->exc_traceback;
      | ^~~~~~~~~~~~~
      | curexc_traceback
bzrlib/_bencode_pyx.c:6860:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
 6860 | tstate->exc_type = *type;
      | ^~~~~~~~
      | curexc_type
bzrlib/_bencode_pyx.c:6861:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
 6861 | tstate->exc_value = *value;
      | ^~~~~~~~~
      | curexc_value
bzrlib/_bencode_pyx.c:6862:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
 6862 | tstate->exc_traceback = *tb;
      | ^~~~~~~~~~~~~
      | curexc_traceback
bzrlib/_bencode_pyx.c: In function ‘__Pyx_ExceptionSave’:
bzrlib/_bencode_pyx.c:6875:21: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
 6875 | *type = tstate->exc_type;
      | ^~~~~~~~
      | curexc_type
bzrlib/_bencode_pyx.c:6876:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
 6876 | *value = tstate->exc_value;
      | ^~~~~~~~~
      | curexc_value
bzrlib/_bencode_pyx.c:6877:19: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
 6877 | *tb = tstate->exc_traceback;
      | ^~~~~~~~~~~~~
      | curexc_traceback
bzrlib/_bencode_pyx.c: In function ‘__Pyx_ExceptionReset’:
bzrlib/_bencode_pyx.c:6889:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
 6889 | tmp_type = tstate->exc_type;
      | ^~~~~~~~
      | curexc_type
bzrlib/_bencode_pyx.c:6890:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
 6890 | tmp_value = tstate->exc_value;
      | ^~~~~~~~~
      | curexc_value
bzrlib/_bencode_pyx.c:6891:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
 6891 | tmp_tb = tstate->exc_traceback;
      | ^~~~~~~~~~~~~
      | curexc_traceback
bzrlib/_bencode_pyx.c:6892:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
 6892 | tstate->exc_type = type;
      | ^~~~~~~~
      | curexc_type
bzrlib/_bencode_pyx.c:6893:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
 6893 | tstate->exc_value = value;
      | ^~~~~~~~~
      | curexc_value
bzrlib/_bencode_pyx.c:6894:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
 6894 | tstate->exc_traceback = tb;
      | ^~~~~~~~~~~~~
      | curexc_traceback
bzrlib/_bencode_pyx.c: In function ‘__Pyx_CyFunction_Call’:
bzrlib/_bencode_pyx.c:7551:9: warning: ‘PyCFunction_Call’ is deprecated [-Wdeprecated-declarations]
 7551 | return PyCFunction_Call(func, arg, kw);
      | ^~~~~~
In file included from /usr/include/python3.9/Python.h:120,
                 from bzrlib/_bencode_pyx.c:4:
/usr/include/python3.9/methodobject.h:33:43: note: declared here
   33 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *);
      | ^~~~~~~~~~~~~~~~
bzrlib/_bencode_pyx.c: In function ‘__pyx_CyFunction_init’:
bzrlib/_bencode_pyx.c:7616:5: warning: ‘PyCFunction_Call’ is deprecated [-Wdeprecated-declarations]
 7616 | __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.9/Python.h:120,
                 from bzrlib/_bencode_pyx.c:4:
/usr/include/python3.9/methodobject.h:33:43: note: declared here
   33 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *);
      | ^~~~~~~~~~~~~~~~

  Cannot build extension "bzrlib._bencode_pyx".
  Use "build_ext --allow-python-fallback" to use slower python implementations instead.

error: command '/usr/bin/gcc' failed with exit code 1

Tags: building
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

You probably want to use Breezy (https://www.breezy-vcs.org/) instead - Bazaar does not support Python 3.

Changed in bzr:
status: New → Confirmed
summary: - unable to build on EndeavourOS
+ python 3 support
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.