[issue5851] Add a stream parameter to gc.set_debug

Nicolas Dumazet report at bugs.python.org
Mon Apr 27 08:24:03 CEST 2009


New submission from Nicolas Dumazet <nicdumz at gmail.com>:

Hello!

gc.set_debug is provided to help debugging a leaking program. That tool
can be very useful indeed. 

Debugging information, however, is written to sys.stderr, and there are
cases where this behavior can be a problem: chances are that stderr can
be already used to output other information.

Currently, to debug a verbose program writing to stderr, one has to
either first reduce/suppress the stderr output noise from its program
before activating set_debug, OR has to redirect the whole mixed stderr
output, and filter it afterwards. 

I'd like very much the possibility to configure myself where the gc
debugger will write its output.

My suggestion would be to have set_debug converted from set_debug(flags)
to set_debug(flags, stream=sys.stderr), stream being any valid file
object, but any solution allowing me to customize the output target of
the gc debugger would be welcome.

Thanks!

----------
components: Extension Modules
messages: 86647
nosy: nicdumz
severity: normal
status: open
title: Add a stream parameter to gc.set_debug
type: feature request
versions: Python 2.7

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


More information about the Python-bugs-list mailing list