Intermittent error

Hi All!

Sometimes I get an error when I try to open a save dialog box.
This is the code where I show the dialog:

        dlg = wx.FileDialog(
            self,_("Save definition"),"",self.dbdef.name,
            DBDEF_WILDCARD,
            wx.SAVE | wx.OVERWRITE_PROMPT | wx.HIDE_READONLY | wx.CHANGE_DIR
        )
        if dlg.ShowModal() == wx.ID_OK:
            f = file(dlg.GetPath(),'wb+')
            try:
                f.write(dumps(self.dbdef))
            finally:
                f.close()
                del f

This is the error message:

Traceback (most recent call last):
  File "C:\Python24\Lib\site-packages\wx-2.6-msw-ansi\wx\_misc.py", line 1118, in Notify
    self.notify()
  File "T:\Python\Lib\mess\wxMegaWidgets\HtmlHint.py", line 86, in EndLeap
    self.leaptimer.Stop()
  File "C:\Python24\Lib\site-packages\wx-2.6-msw-ansi\wx\_misc.py", line 1080, in Stop
    return _misc_.Timer_Stop(*args, **kwargs)
wx._core.PyAssertionError: argument number 1: C++ assertion "wxAssertFailure" failed in ..\..\src\msw\timer.cpp(163): bogus timer id in wxTimerProc

I think it is because my timer was stopped while the standard (windows) save file dialog was the top window on the screen. But it should not throw an exception. What is a "bogus timer id"? Looks like it is an internal error of wxPython or wxWindows. Is it a known error? Or possibly, I could I do something 'invalid' to mess up wxPython?

  Les

Every timer that we start has a unique id>0, and that exceptions is
thrown when the system try to process a timer with an id=0.

Why is it happen? I don't know...
If you can strip your code to a small working sample, maybe you can give
you more help.

Ricardo

···

On Tue, 2005-08-23 at 17:36 +0200, Laszlo Zsolt Nagy wrote:

  Hi All!

Sometimes I get an error when I try to open a save dialog box.
This is the code where I show the dialog:

        dlg = wx.FileDialog(
            self,_("Save definition"),"",self.dbdef.name,
            DBDEF_WILDCARD,
            wx.SAVE | wx.OVERWRITE_PROMPT | wx.HIDE_READONLY |
wx.CHANGE_DIR
        )
        if dlg.ShowModal() == wx.ID_OK:
            f = file(dlg.GetPath(),'wb+')
            try:
                f.write(dumps(self.dbdef))
            finally:
                f.close()
                del f

This is the error message:

Traceback (most recent call last):
  File "C:\Python24\Lib\site-packages\wx-2.6-msw-ansi\wx\_misc.py", line
1118, in Notify
    self.notify()
  File "T:\Python\Lib\mess\wxMegaWidgets\HtmlHint.py", line 86, in EndLeap
    self.leaptimer.Stop()
  File "C:\Python24\Lib\site-packages\wx-2.6-msw-ansi\wx\_misc.py", line
1080, in Stop
    return _misc_.Timer_Stop(*args, **kwargs)
wx._core.PyAssertionError: argument number 1: C++ assertion
"wxAssertFailure" failed in ..\..\src\msw\timer.cpp(163): bogus timer id
in wxTimerProc

I think it is because my timer was stopped while the standard (windows)
save file dialog was the top window on the screen. But it should not
throw an exception. What is a "bogus timer id"? Looks like it is an
internal error of wxPython or wxWindows. Is it a known error? Or
possibly, I could I do something 'invalid' to mess up wxPython?