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.

Author zbentley
Recipients asvetlov, yselivanov, zbentley
Date 2021-08-27.23:56:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1630108585.95.0.412897766167.issue45033@roundup.psfhosted.org>
In-reply-to
Content
If an object's destructor contains native code which calls PyErr_PrintEx, and that object's refcount drops to zero as the result of an async function returning, the async function incorrectly returns None.

I first identified this behavior while using Boost-python. A more detailed description, and steps to reproduce, are in the issue report I filed on that library: https://github.com/boostorg/python/issues/374

I'm not very familiar with interpreter internals, so it is possible that this is expected behavior. However, it does seem like at least a leaky abstraction between the mechanics of async calls (which use exception based control flow internally) and the PyErr_PrintEx function, which is typically invoked by callers interested in finding out about errors that they caused, not errors that are both caused elsewhere and whose propagation is important to preserving call stack state.
History
Date User Action Args
2021-08-27 23:56:25zbentleysetrecipients: + zbentley, asvetlov, yselivanov
2021-08-27 23:56:25zbentleysetmessageid: <1630108585.95.0.412897766167.issue45033@roundup.psfhosted.org>
2021-08-27 23:56:25zbentleylinkissue45033 messages
2021-08-27 23:56:25zbentleycreate