[Idle-dev] CVS: idle rpc.py,1.20,1.21

Neal Norwitz neal@metaslash.com
Sat, 22 Mar 2003 14:40:15 -0500


>       def handle_error(self, request, client_address):
> !         """Override TCPServer method
> ! 
> !         Error message goes to __stderr__.  No error message if exiting
> !         normally or socket raised EOF.  Other exceptions not handled in
> !         server code will cause os._exit.
> ! 
> !         """
>           try:
>               raise
>           except SystemExit:
>               raise
> !         except EOFError:
> !             pass
> !         except:
> !             erf = 'sys.__stderr__'
> !             print>>erf, '-'*40
> !             print>>erf, 'Unhandled server exception!'
> !             print>>erf, 'Thread: %s' % threading.currentThread().getName()
> !             print>>erf, 'Client Address: ', address
> !             print>>erf, 'Request: ', repr(request)
> !             traceback.print_exc(file=erf)
> !             print>>erf, '\n*** Unrecoverable, server exiting!'
> !             print>>erf, '-'*40
> !             import os
> !             os._exit

Did you mean to call os._exit, ie, os._exit()?  Otherwise this doesn't
seem to have any effect.

Neal