-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixestopic-C-APItype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Reproduction:
// asm_builtins/mod.c
#include <Python.h>
static PyObject *
print(PyObject *self, PyObject *args)
{
Py_RETURN_NONE;
}
PyDoc_STRVAR(print__doc__,
"print($module, /, *args)\n"
"--\n"
"\n"
"Print passed args as strings.");
static PyMethodDef module_methods[] = {
{"print", (PyCFunction)print, METH_VARARGS, print__doc__},
{NULL} // sentinel
};
static struct PyModuleDef asm_builtins_spec = {
PyModuleDef_HEAD_INIT,
"asm_builtins",
PyDoc_STR("Builtins re-implemented in ASM"),
-1,
module_methods
};
PyMODINIT_FUNC PyInit_asm_builtins(void) {
printf("errno = %d\n", errno); // this will print `errno=2`
return PyModule_Create(&asm_builtins_spec);
}
I created a repro here: https://github.com/sobolevn/errno-2-repro
You can see that all actions with Python versions from 3.9 to 3.13 print the same errno
on Linux (tested on macos as well - the same).
But, other than that - there are no exceptions / failures / bugs / etc. Everything works.
Is it a bug? Or am I missing something obvious?
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixestopic-C-APItype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error