ionelmc/python-manhole — pull request #23 by nirs (2014-09-27 14:06:16+00:00)
Title: Add redirect_stderr option

This patch adds a new redirect_stderr option. When set to False, only
sys.stdout is patched and used for condole output. The default value is
True, keeping the current behavior.

Redirecting stderr can cause the console to become unusable becuase
Python is writing errors to stderr when it cannot raise an exception.
For example, during interpeter shutdown, or when code in __del__ method
raises an exception.

For example, in vdsm, we get this error every few seconds:

Exception RuntimeError: RuntimeError('cannot notify on un-acquired lock',)
in ignored

While fixing such issues may be possible, it may not be practicle in
large code base. Avoding redirection of stderr allow using manhole in
such case.