I have an application that is causing an error only when the computer is shutdown or restarted. The application sits in the system tray on Windows XP most of the time monitoring when email comes in and alerts the user when that happens. If I close the application myself before restarting or shutting down, it exits as it should. When I don't, I see a "Abort, Retry, Ignore" dialog that usually disappears before I have a chance to press any of the buttons.
In my close method I use the Destroy() method to get rid of my taskbar icon. If I recall correctly, RemoveIcon() didn't work in all cases. I also stop a couple of timers. I tried putting the Destroy and timer stop commands in try/except statements and creating a log on error, but I'm not getting anything written to the log. Does anyone have any tips for tracking this down?
I have an application that is causing an error only when the computer is shutdown or restarted. The application sits in the system tray on Windows XP most of the time monitoring when email comes in and alerts the user when that happens. If I close the application myself before restarting or shutting down, it exits as it should. When I don't, I see a "Abort, Retry, Ignore" dialog that usually disappears before I have a chance to press any of the buttons.
In my close method I use the Destroy() method to get rid of my taskbar icon. If I recall correctly, RemoveIcon() didn't work in all cases. I also stop a couple of timers. I tried putting the Destroy and timer stop commands in try/except statements and creating a log on error, but I'm not getting anything written to the log. Does anyone have any tips for tracking this down?
I'm using wxPython 2.8.9.1 and Python 2.5.
Thanks,
Mike
I will probably ask an obvious question but do you catch the shutting down event from MS-Windows?
(I really don't know whether it exists but I hope to. And I probably can't help you further...)
I have an application that is causing an error only when the computer is shutdown or restarted. The application sits in the system tray on Windows XP most of the time monitoring when email comes in and alerts the user when that happens. If I close the application myself before restarting or shutting down, it exits as it should. When I don't, I see a "Abort, Retry, Ignore" dialog that usually disappears before I have a chance to press any of the buttons.
In my close method I use the Destroy() method to get rid of my taskbar icon. If I recall correctly, RemoveIcon() didn't work in all cases. I also stop a couple of timers. I tried putting the Destroy and timer stop commands in try/except statements and creating a log on error, but I'm not getting anything written to the log. Does anyone have any tips for tracking this down?
I'm using wxPython 2.8.9.1 and Python 2.5.
Thanks,
Mike
I will probably ask an obvious question but do you catch the shutting down event from MS-Windows?
(I really don't know whether it exists but I hope to. And I probably can't help you further...)
Mathias
I catch the frame's EVT_CLOSE, but this doesn't seem good enough for system shutdown. I tried binding to the EVT_QUERY_END_SESSION that is supposed to be sent to the App instance when the OS is shutting down, but Windows XP doesn't appear to send that event. I created a handler that would write a simple string to a file to let me know if it had been caught, but no file gets written. Maybe I should try the 2nd event, EVT_END_SESSION, but I don't see why that would work and the other wouldn't.
I have an application that is causing an error only when the computer is shutdown or restarted. The application sits in the system tray on Windows XP most of the time monitoring when email comes in and alerts the user when that happens. If I close the application myself before restarting or shutting down, it exits as it should. When I don't, I see a "Abort, Retry, Ignore" dialog that usually disappears before I have a chance to press any of the buttons.
In my close method I use the Destroy() method to get rid of my taskbar icon. If I recall correctly, RemoveIcon() didn't work in all cases. I also stop a couple of timers. I tried putting the Destroy and timer stop commands in try/except statements and creating a log on error, but I'm not getting anything written to the log. Does anyone have any tips for tracking this down?
I'm using wxPython 2.8.9.1 and Python 2.5.
Thanks,
Mike
Just in case anyone cares, I finally snapped a screenshot of the error dialog. It's attached. Unfortunately, it's still mostly useless.
I have an application that is causing an error only when the computer is shutdown or restarted. The application sits in the system tray on Windows XP most of the time monitoring when email comes in and alerts the user when that happens. If I close the application myself before restarting or shutting down, it exits as it should. When I don't, I see a "Abort, Retry, Ignore" dialog that usually disappears before I have a chance to press any of the buttons.
In my close method I use the Destroy() method to get rid of my taskbar icon. If I recall correctly, RemoveIcon() didn't work in all cases. I also stop a couple of timers. I tried putting the Destroy and timer stop commands in try/except statements and creating a log on error, but I'm not getting anything written to the log. Does anyone have any tips for tracking this down?
I'm using wxPython 2.8.9.1 and Python 2.5.
Thanks,
Mike
Just in case anyone cares, I finally snapped a screenshot of the error dialog. It's attached. Unfortunately, it's still mostly useless.
Mike
I don't think it would be useful but did you check the MS-Windows application events?
When your application is closed, does it try to access the MS-Windows registry / open a socket/file descriptor (...)?
Do you use threads?
Can you put a big awful try...catch to get more information about the exception?
I have an application that is causing an error only when the computer is shutdown or restarted. The application sits in the system tray on Windows XP most of the time monitoring when email comes in and alerts the user when that happens. If I close the application myself before restarting or shutting down, it exits as it should. When I don't, I see a "Abort, Retry, Ignore" dialog that usually disappears before I have a chance to press any of the buttons.
In my close method I use the Destroy() method to get rid of my taskbar icon. If I recall correctly, RemoveIcon() didn't work in all cases. I also stop a couple of timers. I tried putting the Destroy and timer stop commands in try/except statements and creating a log on error, but I'm not getting anything written to the log. Does anyone have any tips for tracking this down?
I'm using wxPython 2.8.9.1 and Python 2.5.
Thanks,
Mike
Just in case anyone cares, I finally snapped a screenshot of the error dialog. It's attached. Unfortunately, it's still mostly useless.
Mike
I don't think it would be useful but did you check the MS-Windows application events?
When your application is closed, does it try to access the MS-Windows registry / open a socket/file descriptor (...)?
Do you use threads?
Can you put a big awful try...catch to get more information about the exception?
Well, that's all about I think of for the moment.
Mathias
The event logs don't show anything related to my application that I can see. I don't do anything with the registry, sockets or threads. I did find a file that is opened and parsed by the xml minidom module, but I can't tell if that module explicitly closes it. I added some code to try to force it closed, but it doesn't make any difference to the issue.
The try/except on everything was a good idea. I did this:
Unfortunately, it didn't write anything to my log file when the error occurred. I also tried compiling it in py2exe with bundle option 3 instead of 1. This is weird.
I have an application that is causing an error only when the computer is shutdown or restarted. The application sits in the system tray on Windows XP most of the time monitoring when email comes in and alerts the user when that happens. If I close the application myself before restarting or shutting down, it exits as it should. When I don't, I see a "Abort, Retry, Ignore" dialog that usually disappears before I have a chance to press any of the buttons.
In my close method I use the Destroy() method to get rid of my taskbar icon. If I recall correctly, RemoveIcon() didn't work in all cases. I also stop a couple of timers. I tried putting the Destroy and timer stop commands in try/except statements and creating a log on error, but I'm not getting anything written to the log. Does anyone have any tips for tracking this down?
I'm using wxPython 2.8.9.1 and Python 2.5.
Thanks,
Mike
Just in case anyone cares, I finally snapped a screenshot of the error dialog. It's attached. Unfortunately, it's still mostly useless.
Mike
I don't think it would be useful but did you check the MS-Windows application events?
When your application is closed, does it try to access the MS-Windows registry / open a socket/file descriptor (...)?
Do you use threads?
Can you put a big awful try...catch to get more information about the exception?
Well, that's all about I think of for the moment.
Mathias
The event logs don't show anything related to my application that I can see. I don't do anything with the registry, sockets or threads. I did find a file that is opened and parsed by the xml minidom module, but I can't tell if that module explicitly closes it. I added some code to try to force it closed, but it doesn't make any difference to the issue.
The try/except on everything was a good idea. I did this:
<code>
Unfortunately, it didn't write anything to my log file when the error occurred. I also tried compiling it in py2exe with bundle option 3 instead of 1. This is weird.
Mike
I suppose that the dialog with "unhandled exception" is no more shown. If so, you can also try to import StringIO and traceback, prepare the log file before calling MainLoop. Otherwise, I have no more idea... or try to make a simple application which reproduce the problem.
I have an application that is causing an error only when the computer is shutdown or restarted. The application sits in the system tray on Windows XP most of the time monitoring when email comes in and alerts the user when that happens. If I close the application myself before restarting or shutting down, it exits as it should. When I don't, I see a "Abort, Retry, Ignore" dialog that usually disappears before I have a chance to press any of the buttons.
In my close method I use the Destroy() method to get rid of my taskbar icon. If I recall correctly, RemoveIcon() didn't work in all cases. I also stop a couple of timers. I tried putting the Destroy and timer stop commands in try/except statements and creating a log on error, but I'm not getting anything written to the log. Does anyone have any tips for tracking this down?
I'm using wxPython 2.8.9.1 and Python 2.5.
Thanks,
Mike
Just in case anyone cares, I finally snapped a screenshot of the error dialog. It's attached. Unfortunately, it's still mostly useless.
Mike
I don't think it would be useful but did you check the MS-Windows application events?
When your application is closed, does it try to access the MS-Windows registry / open a socket/file descriptor (...)?
Do you use threads?
Can you put a big awful try...catch to get more information about the exception?
Well, that's all about I think of for the moment.
Mathias
The event logs don't show anything related to my application that I can see. I don't do anything with the registry, sockets or threads. I did find a file that is opened and parsed by the xml minidom module, but I can't tell if that module explicitly closes it. I added some code to try to force it closed, but it doesn't make any difference to the issue.
The try/except on everything was a good idea. I did this:
<code>
Unfortunately, it didn't write anything to my log file when the error occurred. I also tried compiling it in py2exe with bundle option 3 instead of 1. This is weird.
Mike
I suppose that the dialog with "unhandled exception" is no more shown. If so, you can also try to import StringIO and traceback, prepare the log file before calling MainLoop. Otherwise, I have no more idea... or try to make a simple application which reproduce the problem.
Mathias
In my struggle to create a small runnable executable, I have yet to create something that replicates the issue. I'll probably just have to re-write the stupid thing. Hopefully it won't take me as many months as it did originally.
Mike, I had the same issue with Task Coach. This solved it for me:
class wxApp(wx.App):
def OnInit(self):
self.Bind(wx.EVT_QUERY_END_SESSION, self.onQueryEndSession)
return True
def onQueryEndSession(self, event):
# This makes sure we don't block shutdown on Windows
pass
HTH, Frank
···
2008/10/29 Mike Driscoll <mdriscoll@co.marshall.ia.us>:
In my struggle to create a small runnable executable, I have yet to create
something that replicates the issue. I'll probably just have to re-write the
stupid thing. Hopefully it won't take me as many months as it did
originally.
2008/10/29 Mike Driscoll <mdriscoll@co.marshall.ia.us>:
In my struggle to create a small runnable executable, I have yet to create
something that replicates the issue. I'll probably just have to re-write the
stupid thing. Hopefully it won't take me as many months as it did
originally.
Mike, I had the same issue with Task Coach. This solved it for me:
class wxApp(wx.App):
def OnInit(self):
self.Bind(wx.EVT_QUERY_END_SESSION, self.onQueryEndSession)
return True
def onQueryEndSession(self, event):
# This makes sure we don't block shutdown on Windows
pass
HTH, Frank
Well, what do you know? This seems to work in my VM. I'll push it out to my problem user tomorrow and my laptop and see if it works there too. If so, then you've solved my problem. If you're ever in Iowa, I owe you some homemade cookies
I'm pretty sure someone helped me with this as well; can't remember
who unfortunately. You know what, just do something nice for someone
random and karma is balanced again
Cheers, Frank
···
2008/10/29 Mike Driscoll <mdriscoll@co.marshall.ia.us>:
Well, what do you know? This seems to work in my VM. I'll push it out to my
problem user tomorrow and my laptop and see if it works there too. If so,
then you've solved my problem. If you're ever in Iowa, I owe you some
homemade cookies
2008/10/29 Mike Driscoll <mdriscoll@co.marshall.ia.us>:
Well, what do you know? This seems to work in my VM. I'll push it out to my
problem user tomorrow and my laptop and see if it works there too. If so,
then you've solved my problem. If you're ever in Iowa, I owe you some
homemade cookies
I'm pretty sure someone helped me with this as well; can't remember
who unfortunately. You know what, just do something nice for someone
random and karma is balanced again
Cheers, Frank
_________________
I'll do that anyway, but thanks for the help! This list has the best members!
I have an application that is causing an error only when the computer is shutdown or restarted. The application sits in the system tray on Windows XP most of the time monitoring when email comes in and alerts the user when that happens. If I close the application myself before restarting or shutting down, it exits as it should. When I don't, I see a "Abort, Retry, Ignore" dialog that usually disappears before I have a chance to press any of the buttons.
In my close method I use the Destroy() method to get rid of my taskbar icon. If I recall correctly, RemoveIcon() didn't work in all cases. I also stop a couple of timers. I tried putting the Destroy and timer stop commands in try/except statements and creating a log on error, but I'm not getting anything written to the log. Does anyone have any tips for tracking this down?
I'm using wxPython 2.8.9.1 and Python 2.5.
I see you've already found a workaround, but here is some more info that I wrote earlier about it.
That dialog usually means that some low level problem has been detected by the runtime, like trying to access memory through a bad pointer, etc. Unfortunately the only tips I have are to try an narrow down what the possible causes might be by either trying to reproduce it in a new minimal app, or by selectively changing or removing things in your current app until the problem goes away.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Unfortunately, it didn't write anything to my log file when the error occurred. I also tried compiling it in py2exe with bundle option 3 instead of 1. This is weird.
Because of the C++ and Python sandwich (C++ & Python Sandwich - wxPyWiki) you won't get anything from that unless there is an exception in the startup code before MainLoop is called. In your case however it is not a Python exception so even if the above worked you still wouldn't get anything.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I have an application that is causing an error only when the computer is shutdown or restarted. The application sits in the system tray on Windows XP most of the time monitoring when email comes in and alerts the user when that happens. If I close the application myself before restarting or shutting down, it exits as it should. When I don't, I see a "Abort, Retry, Ignore" dialog that usually disappears before I have a chance to press any of the buttons.
In my close method I use the Destroy() method to get rid of my taskbar icon. If I recall correctly, RemoveIcon() didn't work in all cases. I also stop a couple of timers. I tried putting the Destroy and timer stop commands in try/except statements and creating a log on error, but I'm not getting anything written to the log. Does anyone have any tips for tracking this down?
I'm using wxPython 2.8.9.1 and Python 2.5.
I see you've already found a workaround, but here is some more info that I wrote earlier about it.
That dialog usually means that some low level problem has been detected by the runtime, like trying to access memory through a bad pointer, etc. Unfortunately the only tips I have are to try an narrow down what the possible causes might be by either trying to reproduce it in a new minimal app, or by selectively changing or removing things in your current app until the problem goes away.
Yeah, I kind of figured that out. I tried creating a minimal example, but after I had recreated the GUI, the timers and the taskbar icons and still hadn't reproduced the error, I started thinking it must be something else. It may be that the lxml module I use for xml parsing doesn't close files immediately when it's done writing or winsound or who knows what?! Anyway, I need to re-write some or all of it because the code isn't as easy to maintain as I would like.