This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Unhandled error results of C API functions
Type: behavior Stage: resolved
Components: Extension Modules, Interpreter Core Versions: Python 3.6, Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: Arfrever, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2015-05-02 16:56 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue24115.patch serhiy.storchaka, 2015-05-21 08:48 review
Messages (3)
msg242407 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-05-02 16:56
PyObject_IsInstance() and PyObject_IsSubclass() cat return 0, 1, or -1. But some code use "if (PyObject_IsInstance(...))" or "if (!PyObject_IsInstance(...))". This should be fixed.
msg243741 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-05-21 08:48
Proposed patch adds handling of error results of following functions: PyObject_IsTrue(), PyObject_Not(), PyObject_IsInstance(), PyObject_RichCompareBool(), _PyDict_Contains(). All these functions usually return 0 or 1, but also can return -1 in the case of error, and this case was not handled in some places.
msg244460 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-05-30 14:49
New changeset 82490d05f3b0 by Serhiy Storchaka in branch '2.7':
Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(),
https://hg.python.org/cpython/rev/82490d05f3b0

New changeset 8167df7d4cd0 by Serhiy Storchaka in branch '3.4':
Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(),
https://hg.python.org/cpython/rev/8167df7d4cd0

New changeset 7d1b81224c3b by Serhiy Storchaka in branch '3.5':
Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(),
https://hg.python.org/cpython/rev/7d1b81224c3b

New changeset f5d1bb0c4192 by Serhiy Storchaka in branch 'default':
Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(),
https://hg.python.org/cpython/rev/f5d1bb0c4192
History
Date User Action Args
2022-04-11 14:58:16adminsetgithub: 68303
2015-05-30 14:50:12serhiy.storchakasetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: + Python 3.6
2015-05-30 14:49:28python-devsetnosy: + python-dev
messages: + msg244460
2015-05-21 08:49:00serhiy.storchakasetfiles: + issue24115.patch
title: PyObject_IsInstance() and PyObject_IsSubclass() can fail -> Unhandled error results of C API functions
messages: + msg243741

keywords: + patch
stage: needs patch -> patch review
2015-05-03 07:18:36Arfreversetnosy: + Arfrever
2015-05-02 16:56:26serhiy.storchakacreate