New submission from Barry A. Warsaw: redirect_stdout is almost exactly what I want, except I want to redirect stderr! redirect_stdout.__init__() should take a 'stream_name' argument (possibly keyword-only) which could be set to 'stderr'. I propose it's implemented as setattr(sys, stream_name, new_target)
---------- components: Library (Lib) messages: 226774 nosy: barry priority: normal severity: normal status: open title: Generalize contextlib.redirect_stdout versions: Python 3.5 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22389> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com