mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Fixed a crash in ctypes, when HAVE_USABLE_WCHAR_T is false.
Fixes issue #4867.
This commit is contained in:
parent
2f947369b3
commit
5e4e4278c9
2 changed files with 4 additions and 1 deletions
|
@ -88,6 +88,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #4867: Fixed a crash in ctypes when passing a string to a
|
||||||
|
function without defining argtypes.
|
||||||
|
|
||||||
- Issue #4272: Add an optional argument to the GzipFile constructor to override
|
- Issue #4272: Add an optional argument to the GzipFile constructor to override
|
||||||
the timestamp in the gzip stream. The default value remains the current time.
|
the timestamp in the gzip stream. The default value remains the current time.
|
||||||
The information can be used by e.g. gunzip when decompressing. Patch by
|
The information can be used by e.g. gunzip when decompressing. Patch by
|
||||||
|
|
|
@ -645,8 +645,8 @@ static int ConvParam(PyObject *obj, Py_ssize_t index, struct argument *pa)
|
||||||
|
|
||||||
#ifdef CTYPES_UNICODE
|
#ifdef CTYPES_UNICODE
|
||||||
if (PyUnicode_Check(obj)) {
|
if (PyUnicode_Check(obj)) {
|
||||||
#ifdef HAVE_USABLE_WCHAR_T
|
|
||||||
pa->ffi_type = &ffi_type_pointer;
|
pa->ffi_type = &ffi_type_pointer;
|
||||||
|
#ifdef HAVE_USABLE_WCHAR_T
|
||||||
pa->value.p = PyUnicode_AS_UNICODE(obj);
|
pa->value.p = PyUnicode_AS_UNICODE(obj);
|
||||||
Py_INCREF(obj);
|
Py_INCREF(obj);
|
||||||
pa->keep = obj;
|
pa->keep = obj;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue