Exception not raised - May be the end

Discussion in 'Python' started by Michele Petrazzo, Mar 2, 2006.

  1. 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
     
    Michele Petrazzo, Mar 2, 2006
    #1
    1. Advertising

  2. 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
     
    Sion Arrowsmith, Mar 3, 2006
    #2
    1. Advertising

  3. 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/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
     
    Michele Petrazzo, Mar 3, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    446
  2. Sam Iam
    Replies:
    0
    Views:
    455
    Sam Iam
    Jan 31, 2004
  3. Lonnie Princehouse
    Replies:
    8
    Views:
    540
    Lonnie Princehouse
    Oct 2, 2004
  4. Michele Petrazzo

    Exception not raised

    Michele Petrazzo, Feb 24, 2006, in forum: Python
    Replies:
    7
    Views:
    328
    Michele Petrazzo
    Feb 25, 2006
  5. kingchuffalo
    Replies:
    0
    Views:
    870
    kingchuffalo
    Sep 21, 2008
Loading...

Share This Page