test/upcast.cpp does not compile since python 3.10
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Área
- testing-qa
Línea de trabajo
Empieza leyendo test/upcast.cpp en las líneas 16-17 y reproduciendo la compilación reportada con los encabezados de Python 3.10 o 3.13. Compara el uso de Py_REFCNT con la Python C API modificada y verifica después que test/upcast.cpp se compile correctamente con las versiones más recientes de Python.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
revision: 3e7be69e1e405e1d5ddd232c69c024ee441592c5
Since Python 3.10, compilation of test/upcast.cpp fails.
$ g++ -Iinclude -I/opt/miniconda3/envs/py310/include/python3.10 test/upcast.cpp
In file included from /usr/include/boost/detail/lightweight_test.hpp:15,
from ./test/upcast.cpp:7:
./test/upcast.cpp: In function 'int main()':
/opt/miniconda3/envs/py310/include/python3.10/object.h:133:33: error: lvalue required as unary '&' operand
133 | #define Py_REFCNT(ob) _Py_REFCNT(_PyObject_CAST_CONST(ob))
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
./test/upcast.cpp:16:17: note: in expansion of macro 'Py_REFCNT'
16 | BOOST_TEST(&Py_REFCNT(boost::python::upcast<PyObject>(&o)) == &Py_REFCNT(&o));
| ^~~~~~~~~
/opt/miniconda3/envs/py310/include/python3.10/object.h:133:33: error: lvalue required as unary '&' operand
133 | #define Py_REFCNT(ob) _Py_REFCNT(_PyObject_CAST_CONST(ob))
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
./test/upcast.cpp:16:68: note: in expansion of macro 'Py_REFCNT'
16 | BOOST_TEST(&Py_REFCNT(boost::python::upcast<PyObject>(&o)) == &Py_REFCNT(&o));
| ^~~~~~~~~
/opt/miniconda3/envs/py310/include/python3.10/object.h:133:33: error: lvalue required as unary '&' operand
133 | #define Py_REFCNT(ob) _Py_REFCNT(_PyObject_CAST_CONST(ob))
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
./test/upcast.cpp:17:17: note: in expansion of macro 'Py_REFCNT'
17 | BOOST_TEST(&Py_REFCNT(boost::python::upcast<PyObject>(&y)) == &Py_REFCNT(&y));
| ^~~~~~~~~
/opt/miniconda3/envs/py310/include/python3.10/object.h:133:33: error: lvalue required as unary '&' operand
133 | #define Py_REFCNT(ob) _Py_REFCNT(_PyObject_CAST_CONST(ob))
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
./test/upcast.cpp:17:68: note: in expansion of macro 'Py_REFCNT'
17 | BOOST_TEST(&Py_REFCNT(boost::python::upcast<PyObject>(&y)) == &Py_REFCNT(&y));
| ^~~~~~~~~
$ g++ -Iinclude -I/usr/include/python3.13 test/upcast.cpp
In file included from /usr/include/boost/detail/lightweight_test.hpp:15,
from test/upcast.cpp:7:
test/upcast.cpp: In function 'int main()':
/usr/include/python3.13/object.h:330:34: error: lvalue required as unary '&' operand
330 | # define Py_REFCNT(ob) Py_REFCNT(_PyObject_CAST(ob))
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
test/upcast.cpp:16:17: note: in expansion of macro 'Py_REFCNT'
16 | BOOST_TEST(&Py_REFCNT(boost::python::upcast<PyObject>(&o)) == &Py_REFCNT(&o));
| ^~~~~~~~~
/usr/include/python3.13/object.h:330:34: error: lvalue required as unary '&' operand
330 | # define Py_REFCNT(ob) Py_REFCNT(_PyObject_CAST(ob))
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
test/upcast.cpp:16:68: note: in expansion of macro 'Py_REFCNT'
16 | BOOST_TEST(&Py_REFCNT(boost::python::upcast<PyObject>(&o)) == &Py_REFCNT(&o));
| ^~~~~~~~~
/usr/include/python3.13/object.h:330:34: error: lvalue required as unary '&' operand
330 | # define Py_REFCNT(ob) Py_REFCNT(_PyObject_CAST(ob))
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
test/upcast.cpp:17:17: note: in expansion of macro 'Py_REFCNT'
17 | BOOST_TEST(&Py_REFCNT(boost::python::upcast<PyObject>(&y)) == &Py_REFCNT(&y));
| ^~~~~~~~~
/usr/include/python3.13/object.h:330:34: error: lvalue required as unary '&' operand
330 | # define Py_REFCNT(ob) Py_REFCNT(_PyObject_CAST(ob))
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
test/upcast.cpp:17:68: note: in expansion of macro 'Py_REFCNT'
17 | BOOST_TEST(&Py_REFCNT(boost::python::upcast<PyObject>(&y)) == &Py_REFCNT(&y));
| ^~~~~~~~~
This is because Py_REFCNT() is changed to the inline static function.
Unfortunately, the CI images use python upto 3.8, so the issue has not been found.
- Lenguaje dominante
- C++
- Estrellas
- 540
- Forks
- 224
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de boostorg/python
-
numpy::from_data calls vector::front and crashes (or has UB) when called with a scalar objectAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
-
Windows CI does not fail if one or more tests failPosiblemente ocupada @stephengtuggy la tomó hace 148 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
-
BoostDetectToolset-1.90.0.cmake file not found in an include() call in boost_python-config.cmakeAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
-
Windows CI: vcpkg dependency caching not workingPosiblemente ocupada @stephengtuggy la tomó hace 148 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Todos los issues de boostorg/python
Issues similares
-
bot-triaged module: correctness (silent) module: fft triage review
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
patrickjquinn/Marathon-Shell#84 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
sav-oss-org/ptusa_main#1610 ·
Los mantenedores suelen responder en 1 día
-
Command gate: one shared constant for the just-below-1e-9 MoveAxis stop epsilon (ZWO, Bisque)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
open-astro/AlpacaBridge#2606 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Refactor force_torque_system integration test to use EcmScopePosiblemente ocupada @patelshivani2283-lab la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día