gtk backend silently ignores all exceptions

Michael,

It seems that the gtk backend in the current svn silently ignores ALL
exceptions raised during the drawing.

http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py?r1=6696&r2=6793

Is this necessary? I don't think we want to do this.

Regards,

-JJ

Sorry. That was a mistake to commit it -- I did this while I was trying to track down a segfault. I will revert it.

Mike

Jae-Joon Lee wrote:

···

Michael,

It seems that the gtk backend in the current svn silently ignores ALL
exceptions raised during the drawing.

http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py?r1=6696&r2=6793

Is this necessary? I don't think we want to do this.

Regards,

-JJ

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

No, it is a bug. Catching blanket exceptions and ignoring them is
never OK -- we need to add a section to the coding guide to this
effect. If absolutely necessary, one can catch blanket exceptions and
log them, eg using cbook.exception_to_str, but they must be reported.
Michael has already fixed this (perhaps it was some detritus left in
from a debugging session?) and I'll make a note in the developer docs
coding guide.

···

On Mon, Jan 26, 2009 at 6:02 PM, Jae-Joon Lee <lee.j.joon@...149...> wrote:

Michael,

It seems that the gtk backend in the current svn silently ignores ALL
exceptions raised during the drawing.

http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py?r1=6696&r2=6793

Is this necessary? I don't think we want to do this.

John Hunter wrote:

Michael,

It seems that the gtk backend in the current svn silently ignores ALL
exceptions raised during the drawing.

http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py?r1=6696&r2=6793

Is this necessary? I don't think we want to do this.

No, it is a bug. Catching blanket exceptions and ignoring them is
never OK -- we need to add a section to the coding guide to this
effect. If absolutely necessary, one can catch blanket exceptions and
log them, eg using cbook.exception_to_str, but they must be reported.
Michael has already fixed this (perhaps it was some detritus left in
from a debugging session?) and I'll make a note in the developer docs
coding guide.

John,

Not quite "always": I think that for something like cbook.is_string_like we actually *do* want to silently catch all exceptions. The problem is that if you know nothing about the type of object that you might have to deal with, you have no way of knowing what exception it might raise. We ran into an example of this recently.

Eric

···

On Mon, Jan 26, 2009 at 6:02 PM, Jae-Joon Lee <lee.j.joon@...149...> wrote:

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel