[New-bugs-announce] [issue42179] Clarify chaining exceptions in tutorial/errors.rst
Vladimir Ryabtsev
report at bugs.python.org
Wed Oct 28 04:31:31 EDT 2020
New submission from Vladimir Ryabtsev <greatvovan at gmail.com>:
A new section has been added to the page as a result of https://bugs.python.org/issue37826. The change: https://github.com/python/cpython/commit/dcfe111eb5602333135b8776996332a8dcf59392
The wording it uses (in the beginning of section 8.5), defines chaining as setting __cause__ attribute in an exception, and later states that "Exception chaining happens automatically when an exception is raised inside an exception handler or finally section". This may lead the reader to a wrong idea that re-raising an exception without "from" in "except" and "finally" automatically sets __cause__. In reality it sets only __context__ attribute, which is similar concept to __cause__, but work a bit differently, as explained in library/exceptions.rst. I suggest to mention that difference and provide a link to the main article.
----------
assignee: docs at python
components: Documentation
messages: 379823
nosy: Vladimir Ryabtsev, docs at python
priority: normal
severity: normal
status: open
title: Clarify chaining exceptions in tutorial/errors.rst
versions: Python 3.10, Python 3.9
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42179>
_______________________________________
More information about the New-bugs-announce
mailing list