[issue5851] Add a stream parameter to gc.set_debug

2019-12-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I am going to close this for now as per my last comment (I think gc callbacks 
are best suited for custom statistics and custom behaviour when emitting the 
statistics - and more importantly, safer -) but feel free to re-open if you 
still think we didn't consider something important.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5851] Add a stream parameter to gc.set_debug

2019-12-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I am not convinced about this. One of the problems I dislike is that the gc 
will take permanent ownership of the file descriptor (so is basically leaked). 
Is also not clear how this will behave during the delicate stages of 
finalization (the stream object provided can be anything that we have no 
control over during finalization) and also, it makes it a bit riskier as this 
can execute arbitrary python code in the middle of the gc.

On the other hand, is possible to use the gc callbacks to gather similar 
statistics about collections doing whatever you need there (like writing to 
file descriptors and the such).

--
nosy: +pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5851] Add a stream parameter to gc.set_debug

2019-12-29 Thread Batuhan


Batuhan  added the comment:

@nicdumz are you still interested in this issue?

--
nosy: +BTaskaya

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5851] Add a stream parameter to gc.set_debug

2013-03-28 Thread Georg Brandl

Georg Brandl added the comment:

Patch would need to be updated for Python 3.4.  (Please also upload it to this 
issue.)

--
nosy: +georg.brandl
versions: +Python 3.4 -Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5851
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5851] Add a stream parameter to gc.set_debug

2009-08-24 Thread Nicolas Dumazet

Nicolas Dumazet nicd...@gmail.com added the comment:

Sure, I'd be happy to contribute a patch.

I uploaded a patch on Rietveld, at http://codereview.appspot.com/110078

Let me know how it looks.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5851
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5851] Add a stream parameter to gc.set_debug

2009-05-27 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Would you like to work on a patch?

--
components: +Interpreter Core -Extension Modules
nosy: +amaury.forgeotdarc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5851
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5851] Add a stream parameter to gc.set_debug

2009-04-27 Thread Nicolas Dumazet

New submission from Nicolas Dumazet nicd...@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 rep...@bugs.python.org
http://bugs.python.org/issue5851
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com