CYGWIN: Python-3.16.0a1 doesn't select correct strerror_r()
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 60/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- c
- Área
- operating-systems
Línea de trabajo
El error está en _Py_strerror en Python/fileutils.c, donde el bloque del preprocesador cerca de la línea 3319 elige Py_STRERROR_R_GNU o la variante XSI, y las dos llamadas a strerror_r cerca de las líneas 3353 y 3373 no compilan en Cygwin. Lee ese bloque de comprobación de características y la condición __CYGWIN__ que propone el reportante, y luego comprueba si configure.ac ya detecta la firma de strerror_r. Está hecho cuando una compilación en Cygwin termina sin errores de int-conversion y se elige la rama GNU allí.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug report
Python-3.16.0a1 has been released, so I tried to build it on Cygwin.
Unfortunately, this error happens:
Python-3.16.0a1/Python/fileutils.c: In function ‘_Py_strerror’:
Python-3.16.0a1/Python/fileutils.c:3353:15: error: initialization of ‘int’ from ‘char *’ makes integer from pointer without a cast [-Wint-conversion]
3353 | int len = strerror_r(code, small_buffer, buflen);
| ^~~~~~~~~~
Python-3.16.0a1/Python/fileutils.c:3373:17: error: assignment to ‘int’ from ‘char *’ makes integer from pointer without a cast [-Wint-conversion]
3373 | len = strerror_r(code, buffer, buflen);
| ^
make: *** [Makefile:3361: Python/fileutils.o] Error 1
I'm thinking that this error comes from a recent change because I had not it in the past builds.
Evidently, Cygwin is also using the GNU version of strerror_r() but the current code doesn't take care of it.
At the moment, I fixed the error with this change:
--- origsrc/Python-3.16.0a1/Python/fileutils.c 2026-10-13 17:05:54.000000000 +0200
+++ src/Python-3.16.0a1/Python/fileutils.c 2026-11-02 13:13:18.366198700 +0100
@@ -3319,7 +3319,7 @@ _Py_strerror(int code)
// Check which strerror_r() API is used
# if defined(__GLIBC__) && !((_POSIX_C_SOURCE >= 200112L) && !defined(_GNU_SOURCE))
# define Py_STRERROR_R_GNU
-# elif defined(__ANDROID__) && defined(_GNU_SOURCE)
+# elif (defined(__ANDROID__) || defined(__CYGWIN__)) && defined(_GNU_SOURCE)
# define Py_STRERROR_R_GNU
# endif
#endif
However, is there a special reason because this test is not done at configure time?
Any comments?
See also issue #149879 "Enhance Cygwin support".
CPython versions tested on:
3.16
Operating systems tested on:
Windows
- Lenguaje dominante
- Python
- Estrellas
- 77.8k
- Forks
- 37.7k
- Merge medio
- 17 h 24 min
- PR fusionados (30 d)
- 716
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
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 python/cpython
-
What's New in 3.12 credits the unstable C API tier to PEP 697 instead of PEP 689Posiblemente ocupada @TheLouisMahdi la tomó hace 1 día. Abiertodocs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
python/cpython#161078 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
OS-windows type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
docs
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
python/cpython#161007 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Null dereferencing of a pointer in initconfig.cPosiblemente ocupada @lazerg la tomó hace 3 días. Abiertointerpreter-core topic-C-API type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
python/cpython#160962 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
tests topic-profiling type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
python/cpython#160881 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de python/cpython
Issues similares
-
Import errors are swallowed: PerthImplicitWatermarker silently becomes NonePosiblemente ocupada @JonRC la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
resemble-ai/Perth#23 ·
-
correction metadata
Dificultad 2/5 Menos de una hora Aptitud para principiantes 65/100
acl-org/acl-anthology#10753 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
earthtojake/text-to-cad#758 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 70/100
DataTalksClub/faq#545 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día