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: Clarify Lang Ref "Compound statements" footnote
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: docs@python, ezio.melotti, gwideman, ncoghlan, petri.lehtinen, python-dev, r.david.murray, sandro.tosi
Priority: normal Keywords: patch

Created on 2011-03-25 08:42 by gwideman, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue11669-default.patch sandro.tosi, 2011-06-25 16:06 review
Messages (7)
msg132072 - (view) Author: Graham Wideman (gwideman) Date: 2011-03-25 08:42
In Language Ref section 7 "Compound Statements":
http://docs.python.org/release/3.1.3/reference/compound_stmts.html
there's a footnote regarding what happens to unhandled exceptions in a try-except statement:

[1] The exception is propagated to the invocation stack only if there is no *finally* clause that negates the exception.

This is very unclearly worded, especially since the reader in need of this footnote is probably familiar with the *except* clause being the one to "negate" an exception, and may well think this footnote is in error.  This footnote could provide a more convincing explanation: 

[1] The exception is propagated to the invocation stack unless there is a finally clause which happens to raise another exception. That new exception causes the old exception to be lost.
msg137816 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-06-07 11:58
Keywords suggest that there should to be a patch here. Where is it?
msg138262 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-06-13 16:27
Sometimes we use the patch keyword for doc issues where someone has suggested a specific new wording but not generated an actual patch.  That seems to be the case here.
msg139092 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2011-06-25 16:05
Just to make explicit what's happening:


>>> try:
...     try:
...         raise TypeError()
...     finally:
...         raise ValueError()
... except TypeError as e:
...     print('mmm')
... 
Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
TypeError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
ValueError

while


>>> try:
...     try:
...         raise TypeError()
...     finally:
...         raise ValueError()
... except ValueError as e:
...     print ('mmm')
... 
mmm
msg139093 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2011-06-25 16:05
Ok, I send it too soon... attached is a patch to fix this bug (it applies on default, 3.2 and 2.7).
msg139152 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-06-26 08:38
New changeset b11e7bc76d07 by Ezio Melotti in branch '2.7':
#11669: rephrase footnote in the Compound Statements page.
http://hg.python.org/cpython/rev/b11e7bc76d07

New changeset 74e9f94d8440 by Ezio Melotti in branch '3.2':
#11669: rephrase footnote in the Compound Statements page.
http://hg.python.org/cpython/rev/74e9f94d8440

New changeset a7099a3b5e5f by Ezio Melotti in branch 'default':
#11669: merge with 3.2.
http://hg.python.org/cpython/rev/a7099a3b5e5f
msg139153 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2011-06-26 08:41
Fixed, thanks for the patch!
History
Date User Action Args
2022-04-11 14:57:15adminsetgithub: 55878
2011-07-21 09:33:42ezio.melottisetnosy: + ncoghlan
2011-06-26 08:41:23ezio.melottisetstatus: open -> closed

assignee: docs@python -> ezio.melotti

nosy: + ezio.melotti
messages: + msg139153
resolution: fixed
stage: patch review -> resolved
2011-06-26 08:38:38python-devsetnosy: + python-dev
messages: + msg139152
2011-06-25 16:06:18sandro.tosisetkeywords: - needs review
files: + issue11669-default.patch
2011-06-25 16:05:53sandro.tosisetmessages: + msg139093
2011-06-25 16:05:24sandro.tosisetnosy: + sandro.tosi
messages: + msg139092
2011-06-13 16:28:07r.david.murraysetversions: - Python 3.1
2011-06-13 16:27:16r.david.murraysetnosy: + r.david.murray
messages: + msg138262
2011-06-07 11:58:54petri.lehtinensetnosy: + petri.lehtinen
messages: + msg137816
2011-03-25 16:10:34eric.araujosetkeywords: + patch, needs review
stage: patch review
versions: - Python 2.6, Python 2.5, Python 3.4
2011-03-25 08:42:54gwidemancreate