[New-bugs-announce] [issue19403] Make contextlib.redirect_stdout reentrant

Nick Coghlan report at bugs.python.org
Sat Oct 26 08:43:50 CEST 2013


New submission from Nick Coghlan:

I realised making contextlib.redirect_stdout reentrant was actually fairly easy (thread safety is inherently impossible due to the process global side effect). Since making it reentrant makes it more user-friendly, I'll tweak the implementation to work that way.

Need to resolve issue 19330 first, though.

As part of this change, the reusable-but-not-reentrant example in the docs needs to be updated to use contextlib.ExitStack rather than this (that's inherently not reentrant, since all the context managers in the stack would be triggered when the innermost context ends).

----------
assignee: ncoghlan
messages: 201318
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Make contextlib.redirect_stdout reentrant
type: enhancement
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19403>
_______________________________________


More information about the New-bugs-announce mailing list