Exception not raised - May be the end

  • Thread starter Michele Petrazzo
  • Start date
M

Michele Petrazzo

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
 
S

Sion Arrowsmith

Michele Petrazzo said:
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.
 
M

Michele Petrazzo

Sion said:
Michele Petrazzo said:
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/Mail/Message/wxpython-users/3034524

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

Thanks a lot for the tip!

Michele
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top