473,411 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Exception not raised - May be the end

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
Mar 2 '06 #1
2 1199
Michele Petrazzo <mi**************@TOGLIunipex.it> 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 -- si***@chiark.greenend.org.uk -- 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
Mar 3 '06 #2
Sion Arrowsmith wrote:
Michele Petrazzo <mi**************@TOGLIunipex.it> 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
Mar 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: William Park | last post by:
(crossposted to comp.lang.python, because this may be of interest to them.) Python has try-block, within which you can raise exception. Once it's raised, execution breaks out of the try-block...
8
by: Lonnie Princehouse | last post by:
In a recent post, Michele Simionato asked about resumable (or re-entrant) exceptions, the basic idea being that when raised and uncaught, these exceptions would only propagate backwards through a...
8
by: StepH | last post by:
Hi, I've this module : from optparse import OptionParser import re _version = "P1" def writeVar(f, line):
3
by: MackS | last post by:
Hi I'm new to Python and would like to know if the following is possible. Say I have one lower-level object A and one user-interface object B. Suppose B.CallingMethod() calls A.CalledMethod(),...
3
by: mirandacascade | last post by:
Verion of Python: 2.4 O/S: Windows XP ElementTree resides in the c:\python24\lib\site-packages\elementtree\ folder When a string that does not contain well-formed XML is passed as an argument...
5
by: juergen perlinger | last post by:
Hello out there. sometimes I need to have proper control of the floating point arithmetic of the C(and C++) runtime system, and using the f.p. exception handling of the C99 standard is quite...
3
by: elziko | last post by:
I have a procedure that creates a bitmap of a certain size and then displays it in a 3rd party component. However, if the bitmap is very large then a System.OutOfMemoryException is thrown my...
1
by: Bob | last post by:
In Vs 2005 you have new applicationsEvents.vb I was testing it in a simple app and found that it was easier to implement unhandled exception management tah it was in Vs2003 (vb.net) You can, if you...
132
by: Zorro | last post by:
The simplicity of stack unraveling of C++ is not without defective consequences. The following article points to C++ examples showing the defects. An engineer aware of defects can avoid...
5
by: =?Utf-8?B?c3VydHVyeg==?= | last post by:
Hi, I feel like a noob for asking this. When I publish a VB windows application, I want to disable the ability of the the user to continue when there is an unhandled exception. For example,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.