Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Exception not raised - May be the end

Reply
Thread Tools

Exception not raised - May be the end

 
 
Michele Petrazzo
Guest
Posts: n/a
 
      03-02-2006
Hi group,
some days ago I posted here and say that python "forgot" to raise an
exception, but my code was too long for make some tries possible.
But now I can reproduce the problem into another, little, project:

(Need wx 2.6)

Here is the code:

www.unipex.it/vario/wxFrameSchedule.py
www.unipex.it/vario/metamenus.py.py

Execute the wxFrameSchedule.py into a terminal (or where you want) and
select on menu bar:
Show -> Only work hour

The program print and "forgot" to raise an exception:

12 #e number before the call that "must", but don't raise the exception
<type 'dict'> False # variable type and if the value are inside the keys
# (str in dict)
#Here the program don't raise the KeyError exception.

Le lines are:
- 44 in wxFrameSchedule (self._mb.GetMenuState("ShowOnlyworkhour"))
- 802 in metamenus (this = self.MBStrings[_prefixMB + menu_string])

Hope that someone can reproduce this error. I see it on win2k (terminal
usage) and debian (terminal and eric3 )...

py 2.3.5 and wx 2.6


Thanks a lot,
Michele
 
Reply With Quote
 
 
 
 
Sion Arrowsmith
Guest
Posts: n/a
 
      03-03-2006
Michele Petrazzo <> wrote:
>some days ago I posted here and say that python "forgot" to raise an
>exception, but my code was too long for make some tries possible.
>But now I can reproduce the problem into another, little, project:
>
>www.unipex.it/vario/wxFrameSchedule.py
>www.unipex.it/vario/metamenus.py
> [ ... ]


It looks like a "wx sandwich" issue to me: the exception is certainly
being raised and can be caught in wxFrameSchedule.OnMbWorkHour, but
OnMbWorkHour is being called from the C++ wx event loop and I'd guess
that the Python exception isn't being propogated across the C++ layer
back out to the default handler in the Python interpretter. Robin gave
a full explanation to someone else having similar problems on
wxPython-users a couple of days ago, but I'm having trouble finding
that.

--
\S -- -- http://www.chaos.org.uk/~sion/
___ | "Frankly I have no feelings towards penguins one way or the other"
\X/ | -- Arthur C. Clarke
her nu becomež se bera eadward ofdun hlęddre heafdes bęce bump bump bump
 
Reply With Quote
 
 
 
 
Michele Petrazzo
Guest
Posts: n/a
 
      03-03-2006
Sion Arrowsmith wrote:
> Michele Petrazzo <> wrote:
>> some days ago I posted here and say that python "forgot" to raise
>> an exception, but my code was too long for make some tries
>> possible. But now I can reproduce the problem into another, little,
>> project:
>>
>> www.unipex.it/vario/wxFrameSchedule.py
>> www.unipex.it/vario/metamenus.py [ ... ]

>
> It looks like a "wx sandwich" issue to me


Yes! Now I think the same

> Robin gave a full explanation to someone else having similar problems
> on wxPython-users a couple of days ago, but I'm having trouble
> finding that.
>


Yes, I had read it, but I didn't think that was I similar problem!

This is the message
http://aspn.activestate.com/ASPN/Mai...-users/3034524

I hope that, like Robin says, this will be changed into 2.7!

Thanks a lot for the tip!

Michele
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception not raised Michele Petrazzo Python 7 02-25-2006 10:37 AM
Page not displaying when exception raised pbo.spam@gmail.com ASP .Net 5 11-07-2005 02:13 PM
: an exception raised =?Utf-8?B?SklNLkgu?= ASP .Net 9 06-03-2005 03:22 PM
exception raised for valid variable declaration? Carlos ASP .Net 1 02-17-2005 08:26 PM
Exception feature creep! (was: re-entering in the normal flow after an exception is raised) Lonnie Princehouse Python 8 10-02-2004 09:16 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57