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.

Title: Document C API functions which swallow exceptions
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7, Python 3.6
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, eric.snow, miss-islington, ned.deily, rhettinger, ronaldoussoren, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2018-12-11 13:27 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11119 closed serhiy.storchaka, 2018-12-11 13:29
PR 11209 merged miss-islington, 2018-12-18 11:57
PR 11210 merged miss-islington, 2018-12-18 11:57
Messages (5)
msg331620 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-12-11 13:27
C API functions like PyDict_GetItem() and PyObject_HasAttr() suppresses all errors that may occur, including MemoryError and KeyboardInterrupt. They can return incorrect result when the memory is exhausted or the user presses Ctrl-C. The proposed PR documents such functions and suggests the C API which do not swallow unrelated exceptions.

Previous attempt to document this (for PyDict_GetItem() only) was in issue20615.
msg332053 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-12-18 11:57
New changeset 3fcc1e08db6fb7e17acc4a8f63be3e42f52f094b by Serhiy Storchaka in branch 'master':
bpo-35461: Document C API functions which suppress exceptions. (GH-11119)
msg332077 - (view) Author: miss-islington (miss-islington) Date: 2018-12-18 20:24
New changeset f265afec1c2a5acb8cb9c9ddb6cd45f7465c6eb5 by Miss Islington (bot) in branch '3.7':
bpo-35461: Document C API functions which suppress exceptions. (GH-11119)
msg332114 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-12-19 09:24
There are too much differences in the C API and the documentation between 3.x and 2.7, so backporting to 2.7 is not practical.
msg332262 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-12-20 21:28
New changeset ff740db42326082fac7d415ae9aff148628a83ed by Ned Deily (Miss Islington (bot)) in branch '3.6':
bpo-35461: Document C API functions which suppress exceptions. (GH-11119) (GH-11210)
Date User Action Args
2022-04-11 14:59:09adminsetgithub: 79642
2018-12-20 21:28:32ned.deilysetnosy: + ned.deily
messages: + msg332262
2018-12-19 09:24:15serhiy.storchakasetstatus: open -> closed
versions: - Python 2.7
messages: + msg332114

resolution: fixed
stage: patch review -> resolved
2018-12-18 20:24:43miss-islingtonsetnosy: + miss-islington
messages: + msg332077
2018-12-18 11:57:47miss-islingtonsetpull_requests: + pull_request10447
2018-12-18 11:57:40miss-islingtonsetpull_requests: + pull_request10446
2018-12-18 11:57:19serhiy.storchakasetmessages: + msg332053
2018-12-13 07:39:11serhiy.storchakasetnosy: + eric.snow
2018-12-11 13:48:48serhiy.storchakalinkissue35460 dependencies
2018-12-11 13:29:32serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request10349
2018-12-11 13:27:28serhiy.storchakacreate