Issue 21061: Is contextlib.redirect_stdout reentrant or not? (original) (raw)

Created on 2014-03-25 09:36 by perey, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue21061.diff berker.peksag,2014-10-11 10:26 review
Messages (5)
msg214801 - (view) Author: Timothy Pederick (perey) Date: 2014-03-25 09:36
The docs are contradictory on whether or not contextlib.redirect_stdout is reentrant, or reusable-but-not-reentrant. This would seem to be an oversight from , which probably should have changed "reusable but not reentrant" to "reentrant". Present in both current and upcoming docs: http://docs.python.org/3/library/contextlib.html http://docs.python.org/3.5/library/contextlib.html contextlib.redirect_stdout(new_target) ... This context manager is reusable but not reentrant. 29.6.3.1. Reentrant context managers ... threading.RLock is an example of a reentrant context manager, as are suppress() and redirect_stdout(). ... Note also that being reentrant is not the same thing as being thread safe. redirect_stdout(), for example...
msg214804 - (view) Author: Alyssa Coghlan (ncoghlan) * (Python committer) Date: 2014-03-25 10:34
Indeed, it is actually reentrant now - the part that claims it isn't needs to be tweaked appropriately.
msg229074 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-10-11 10:26
Here is a simple patch to correct the redirect_stdout documentation.
msg229108 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-10-12 00:25
New changeset dafbd78ac15b by Nick Coghlan in branch '3.4': Issue #21061: correctly note redirect_stdout is reentrant https://hg.python.org/cpython/rev/dafbd78ac15b New changeset 83540d7b7366 by Nick Coghlan in branch 'default': Merge issue #21061 fix from 3.4 https://hg.python.org/cpython/rev/83540d7b7366
msg229110 - (view) Author: Alyssa Coghlan (ncoghlan) * (Python committer) Date: 2014-10-12 00:27
Thanks folks - the outdated cross reference has been updated as Berker suggested.
History
Date User Action Args
2022-04-11 14:58:00 admin set github: 65260
2014-10-12 00:27:41 ncoghlan set status: open -> closedtype: enhancementmessages: + resolution: fixedstage: patch review -> resolved
2014-10-12 00:25:59 python-dev set nosy: + python-devmessages: +
2014-10-11 17:20:47 rhettinger set assignee: rhettinger -> ncoghlan
2014-10-11 17:11:07 rhettinger set assignee: docs@python -> rhettingernosy: + rhettinger
2014-10-11 10:26:52 berker.peksag set files: + issue21061.diffnosy: + berker.peksagmessages: + keywords: + patchstage: patch review
2014-03-25 10:34:03 ncoghlan set messages: +
2014-03-25 10:21:04 berker.peksag set nosy: + ncoghlan
2014-03-25 09:36:05 perey create