Hallo,
Python 3.12 has removed PyUnicode_GetSize.
However, that function is still used by some Windows code in _cffi_backend.c [0].
Unfortunately, when compiling, MSVC will just emit a warning and not error out:
c/_cffi_backend.c(4518): warning C4013: 'PyUnicode_GetSize' undefined; assuming extern returning int
As a consequence, calling cffi.dlopen(some_filename) will crash.
It's not totally clear to me why the _cffi_backend DLL loads at all though...
Anyway, the line:
sz1 = PyUnicode_GetSize(filename_unicode) + 1;
could be replaced by:
#if PY_MAJOR_VERSION < 3
sz1 = PyUnicode_GetSize(filename_unicode) + 1;
#else
sz1 = PyUnicode_GetLength(filename_unicode) + 1;
#endif
Of course, it would be much better if Python passed the flagged '/we4013' to MSVC.
Thanks,
HE