Re: Exception Handling in TCPServer (was; Problem exiting application in Windows Console.)

2006-11-09 Thread Ant
Steve Holden wrote: ... > First of all, five hour response time is a high expectation, you must be > a Platinum customer :-) I'm in the last week of my current job - start a new one on Monday, and so I haven't got a great deal to do at the moment. Five hours is a lifetime when you're staring at a

Re: Problem exiting application in Windows Console.

2006-11-08 Thread Gabriel Genellina
At Wednesday 8/11/2006 09:10, Ant wrote: [getting a stack trace for SystemExit instead of a clean exit] class HelpHTTPRequestHandler(SimpleHTTPRequestHandler): def do_GET(self): print "PATH: ", self.path if self.path.endswith("quit.html"): print "Exiting..."

Re: Exception Handling in TCPServer (was; Problem exiting application in Windows Console.)

2006-11-08 Thread Matimus
> This seems a really nasty hack though - any ideas for a cleaner way to > do it? You could overload handle_request instead. I think that makes more sense anyway because you don't want to handle a SystemExit exception as an error, you want to exit. Of course this only deals with catching the excep

Re: Exception Handling in TCPServer (was; Problem exiting application in Windows Console.)

2006-11-08 Thread Steve Holden
Ant wrote: > Ant wrote: > >> OK, I've narrowed the problem back to the way HTTPServer (actually its >> TCPServer parent) handles exceptions thrown by the process_request >> method by catching them all, and then calling a handle_error method. >> There doesn't seem to be a way of getting at the

Re: Exception Handling in TCPServer (was; Problem exiting application in Windows Console.)

2006-11-08 Thread Ant
Ant wrote: ... > OK, I've narrowed the problem back to the way HTTPServer (actually its > TCPServer parent) handles exceptions thrown by the process_request > method by catching them all, and then calling a handle_error method. > There doesn't seem to be a way of getting at the exception thrown >

Exception Handling in TCPServer (was; Problem exiting application in Windows Console.)

2006-11-08 Thread Ant
Ant wrote: ... > However, at this point instead of getting back to a command prompt, I > get an unresponsive console. Hitting CTRL-Break gets me the command > prompt back, but I would have expected to get back the command prompt > as soon as the sys.exit(0) had completed. ... > class HelpHTTPReque

Problem exiting application in Windows Console.

2006-11-08 Thread Ant
Hi all, I'm putting together a simple help module for my applications, using html files stored in the application directory somewhere. Basically it sets up a basic web server, and then uses the webbrowser module to display it in the users browser. I have it set up to call sys.exit(0) if the url qu