[New-bugs-announce] [issue3554] ctypes.wstring_at and string_at call Python API without the GIL

Kevin Watters report at bugs.python.org
Thu Aug 14 18:39:52 CEST 2008


New submission from Kevin Watters <kevinwatters at gmail.com>:

in Lib/ctypes/__init__.py the wstring_at and string_at functions are
declared with CFUNCTYPE.

This means that in Modules/_ctypes/callproc.c when the functions are
invoked, Py_UNBLOCK_THREADS and Py_BLOCK_THREADS surround the call. But
string_at and wstring_at call PyString_FromString and
PyUnicode_FromWideChar, respectively.

The solution (I think) is to declare the functions with PYFUNCTYPE
instead, so that callproc.c doesn't release the GIL when calling them.

----------
assignee: theller
components: ctypes
messages: 71135
nosy: kevinwatters, theller
severity: normal
status: open
title: ctypes.wstring_at and string_at call Python API without the GIL
type: crash
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3554>
_______________________________________


More information about the New-bugs-announce mailing list