Index: Modules/_ctypes/callproc.c =================================================================== --- Modules/_ctypes/callproc.c (révision 80063) +++ Modules/_ctypes/callproc.c (copie de travail) @@ -1371,7 +1371,8 @@ static PyObject *py_dl_open(PyObject *self, PyObject *args) { - char *name; + PyObject *name; + char *name_str; void * handle; #ifdef RTLD_LOCAL int mode = RTLD_NOW | RTLD_LOCAL; @@ -1379,10 +1380,16 @@ /* cygwin doesn't define RTLD_LOCAL */ int mode = RTLD_NOW; #endif - if (!PyArg_ParseTuple(args, "z|i:dlopen", &name, &mode)) + if (!PyArg_ParseTuple(args, "O&|i:dlopen", + PyUnicode_FSConverter, &name, &mode)) return NULL; mode |= RTLD_NOW; - handle = ctypes_dlopen(name, mode); + if (PyBytes_Check(name)) + name_str = PyBytes_AS_STRING(name); + else + name_str = PyByteArray_AS_STRING(name); + handle = ctypes_dlopen(name_str, mode); + Py_XDECREF(name); if (!handle) { char *errmsg = ctypes_dlerror(); if (!errmsg)