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: doc: contextlib.suppress documentation is imprecise
Type: Stage: resolved
Components: Documentation, Library (Lib) Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: MapleCCC, docs@python, eric.smith, iritkatriel, miss-islington, rhettinger
Priority: normal Keywords: patch

Created on 2021-06-01 18:02 by iritkatriel, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 26428 merged MapleCCC, 2021-06-01 18:02
PR 26480 merged iritkatriel, 2021-06-01 21:36
PR 26481 merged iritkatriel, 2021-06-01 21:37
PR 26492 merged iritkatriel, 2021-06-02 22:24
PR 26538 merged miss-islington, 2021-06-04 22:08
PR 26539 merged miss-islington, 2021-06-04 22:08
Messages (10)
msg394863 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-06-01 18:02
"suppresses any of the specified exceptions if they occur in the body of a with statement"

Should be:

"suppresses any of the specified exceptions if they are raised in the body of a with statement"
msg394866 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-06-01 20:15
New changeset 87272b70f157af76cb14ff90d73dfc5d9bfb945a by MapleCCC in branch 'main':
bpo-44279: [doc] reword contextlib.suppress documentation (GH-26428)
https://github.com/python/cpython/commit/87272b70f157af76cb14ff90d73dfc5d9bfb945a
msg394875 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-06-01 21:58
New changeset 6563ea5c60be2e4896df52eff777aa93743f1551 by Irit Katriel in branch '3.10':
[3.10] bpo-44279: [doc] reword contextlib.suppress documentation (GH-26428) (GH-26480)
https://github.com/python/cpython/commit/6563ea5c60be2e4896df52eff777aa93743f1551
msg394876 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-06-01 22:15
New changeset 9a688624973a2b753b84f892b65268543c7ff67d by Irit Katriel in branch '3.9':
[3.9] bpo-44279: [doc] reword contextlib.suppress documentation (GH-26428) (GH-26481)
https://github.com/python/cpython/commit/9a688624973a2b753b84f892b65268543c7ff67d
msg394886 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2021-06-02 03:14
I think the old wording was better.  Code can explicitly raise an exception, but other exceptions just occur when calling builtin functions or with a keyboard interrupt.
msg394899 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-06-02 09:22
I see, that’s a good point. Any suggestion regarding the original confusion with warnings? (See PR 26428).
msg394949 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2021-06-02 22:18
I'm not sure the original version needs improving.

This sounds like a problem understanding how warnings work.

Do you really want to say that for warnings, they're sometimes handled by the warning machinery and therefore don't get passed along to the calling code? It seems to me that you'd need to explain that everywhere the documents discuss handling exceptions. I don't think this one place is more special than others.
msg395129 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-06-04 22:08
New changeset dda9ecbfece28aad7b8ba7eaf7951dd9816f78b1 by Irit Katriel in branch 'main':
bpo-44279: revert 'exceptions are raised' back to 'exceptions occur' (GH-26492)
https://github.com/python/cpython/commit/dda9ecbfece28aad7b8ba7eaf7951dd9816f78b1
msg395130 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-06-04 22:09
New changeset ea298e1e33eb03b2b4ea2f4556e59b11e3bf240f by Miss Islington (bot) in branch '3.9':
bpo-44279: revert 'exceptions are raised' back to 'exceptions occur' (GH-26492) (GH-26539)
https://github.com/python/cpython/commit/ea298e1e33eb03b2b4ea2f4556e59b11e3bf240f
msg395131 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-06-04 22:10
New changeset 1065ba66b535b786d6dc5f7d912c6486d9a834ae by Miss Islington (bot) in branch '3.10':
bpo-44279: revert 'exceptions are raised' back to 'exceptions occur' (GH-26492) (GH-26538)
https://github.com/python/cpython/commit/1065ba66b535b786d6dc5f7d912c6486d9a834ae
History
Date User Action Args
2022-04-11 14:59:46adminsetgithub: 88445
2021-06-04 22:10:57iritkatrielsetstatus: open -> closed
stage: patch review -> resolved
2021-06-04 22:10:11iritkatrielsetmessages: + msg395131
2021-06-04 22:09:49iritkatrielsetmessages: + msg395130
2021-06-04 22:08:13miss-islingtonsetpull_requests: + pull_request25130
2021-06-04 22:08:07miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request25129
2021-06-04 22:08:04iritkatrielsetmessages: + msg395129
2021-06-02 22:24:16iritkatrielsetstage: resolved -> patch review
pull_requests: + pull_request25088
2021-06-02 22:18:08eric.smithsetmessages: + msg394949
2021-06-02 09:22:26iritkatrielsetstatus: closed -> open

messages: + msg394899
2021-06-02 03:14:08rhettingersetnosy: + rhettinger, eric.smith
messages: + msg394886
2021-06-01 22:16:20iritkatrielsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-06-01 22:15:55iritkatrielsetmessages: + msg394876
2021-06-01 21:58:13iritkatrielsetmessages: + msg394875
2021-06-01 21:37:40iritkatrielsetpull_requests: + pull_request25078
2021-06-01 21:36:26iritkatrielsetpull_requests: + pull_request25077
2021-06-01 20:15:37iritkatrielsetmessages: + msg394866
2021-06-01 18:02:58MapleCCCsetkeywords: + patch
nosy: + MapleCCC

pull_requests: + pull_request25075
stage: patch review
2021-06-01 18:02:31iritkatrielcreate