[docs] [issue24937] Multiple problems in getters & setters in capsulethunk.h

Petr Viktorin report at bugs.python.org
Tue Aug 25 18:41:33 CEST 2015


New submission from Petr Viktorin:

In https://docs.python.org/3/howto/cporting.html#cobject-replaced-with-capsule (added in issue13053):

1) __PyCapsule_GetField is defined as::

    #define __PyCapsule_GetField(capsule, field, default_value) ...

but called as::

    __PyCapsule_GetField(capsule, field)


2) __PyCapsule_SetField returns the wrong value (1 for success, 0 for failure).

3) Both the getter and setter don't set the exception on failure, leading to "SystemError: error return without exception set".

Here's a patch.

----------
assignee: docs at python
components: Documentation
files: capsulethunk.patch
keywords: patch
messages: 249138
nosy: docs at python, encukou, larry, ncoghlan
priority: normal
severity: normal
status: open
title: Multiple problems in getters & setters in capsulethunk.h
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40256/capsulethunk.patch

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


More information about the docs mailing list