"False exceptions?" (was Re: theme of the week: tools

Dan Perl danperl at rogers.com
Mon Sep 27 02:26:01 EDT 2004


I've done a little more digging into the Wing IDE documentation and this is 
one of the better explanations I've found on the "false exceptions":

 "As you try out the various demos from the tree on the left of the wxPython 
demo app, you will sometimes see Wing IDE report exceptions in its Error 
List dialog, which will come to the front as the wxPython demo pauses at the 
exception. These are not program errors or a malfunction of the IDE. As 
described at the end of the Error List text, these are caused by Wing's 
proactive exception detection algorithm, which cannot see into the C and C++ 
code that is handling these exceptions outside of the debugger.
To get past them, select "Ignore this exception location" in the Error List 
window and click on Continue Execution. You will see 3-4 of these the first 
time Wing IDE encounters them. After that, your ignore list is stored in the 
project so you will never see them again, even in future debug sessions. 
Subsequently, you will benefit from Wing's ability to stop immediately at 
the point of exception, rather than after the fact. This makes understanding 
the conditions leading to an error much easier and speeds up debug 
turn-around."

I can see a benefit in stopping at the point of exception, but if that 
causes false positives (term used by one of their support people) with the 
builtin modules that are implemented in C/C++, then I'd rather just live 
without this benefit.  Apparently, there is a way to disable that behavior 
(I found out about it only now), but Wing keeps recommending the "Ignore 
this exception location" solution.

And here is the kind of comment that really bothers me.  An actual statement 
from their documentation ("Debugging Zope with Wing IDE"):

"Another useful exception related feature is the ability to ignore 
exceptions selectively by line of code on which they occur. You can choose 
this option in the Error List window that comes up when an exception occurs. 
In Zope, as in other Python apps that contain some non-Python code, Wing 
will incorrectly identify some exceptions as unhandled because it cannot see 
whether enclosing C code is going to handle the exception. This usually 
happens in 1-2 places in Zope and can be dealt with by ignoring subsequent 
instances of the exception. The zope.wpr project distributed with the 
Wing+Zope bundle already has these ignores in place."

No, this is NOT a "useful exception related feature", it's a workaround for 
a bug.  And it's 1-2 times for Zope, it was 3-4 times in the comments above, 
how do they get these estimates?  I got this problem (er, useful exception 
related feature) with the first script I debugged.

Dan

"Carlos Ribeiro" <carribeiro at gmail.com> wrote in message 
news:mailman.3947.1096250696.5135.python-list at python.org...
> On Sun, 26 Sep 2004 21:36:18 -0400, Peter Hansen <peter at engcorp.com> 
> wrote:
>> Dan Perl wrote:
>> > I debugged one of my
>> > scripts (that I knew it works) and got an unexplainable exception.  It 
>> > turns
>> > out that Wing IDE falsely detects some exceptions.  They know about it 
>> > and
>> > they suggest that if you KNOW that it's a false exception you should 
>> > flag it
>> > to be ignored.  Yes, Wingware people, I know it's a false exception, 
>> > but
>>
>> What exactly is a "false exception"?  I have never heard of such
>> a thing, and can't imagine what it might be.  Python raises
>> exceptions, they are subclasses of Exception or (old-style)
>> strings, they have tracebacks, they come from a variety of
>> sources, there's lots of things to know about exceptions but
>> "falseness" is not something about which I'm aware...
>
> They're false in the sense that that they're not supposed to be raised
> to the attention of the user. What happens is that Wing IDE is super
> sensitive with regards to exceptions; when an exception is raised in
> some internal module, Wing tries to outsmart the library and warn the
> user that an exception happened. A "false exception" is one that would
> happen and be silently treated by the library itself, without nobody
> noticing, but that's catched by Wing IDE nonetheless, in a totally
> unnecessary and obstrusive way. You can see that it's a case where the
> tool tries to be too smart for its own good.
>
> p.s. Why do they do it? For what I could see, the intention seems to
> be able to catch situations where a valid exception that should be
> raised to the user attention is silented by a generic error handler.
> It really may be useful in some situations, but it isn't a reasonable
> default in my opinion.
>
> -- 
> Carlos Ribeiro
> Consultoria em Projetos
> blog: http://rascunhosrotos.blogspot.com
> blog: http://pythonnotes.blogspot.com
> mail: carribeiro at gmail.com
> mail: carribeiro at yahoo.com 





More information about the Python-list mailing list