@@ -387,14 +387,21 @@ def handle_error(self, request, client_address):
387387 thread .interrupt_main ()
388388 except :
389389 erf = sys .__stderr__
390- print ('\n ' + '-' * 40 , file = erf )
391- print ('Unhandled server exception!' , file = erf )
392- print ('Thread: %s' % threading .current_thread ().name , file = erf )
393- print ('Client Address: ' , client_address , file = erf )
394- print ('Request: ' , repr (request ), file = erf )
395- traceback .print_exc (file = erf )
396- print ('\n *** Unrecoverable, server exiting!' , file = erf )
397- print ('-' * 40 , file = erf )
390+ print (textwrap .dedent (f"""
391+ { '-' * 40 }
392+ Unhandled exception in user code execution server!'
393+ Thread: { threading .current_thread ().name }
394+ IDLE Client Address: { client_address }
395+ Request: { request !r}
396+ """ ), file = erf )
397+ traceback .print_exc (limit = - 20 , file = erf )
398+ print (textwrap .dedent (f"""
399+ *** Unrecoverable, server exiting!
400+
401+ Users should never see this message; it is likely transient.
402+ If this recurs, report this with a copy of the message
403+ and an explanation of how to make it repeat.
404+ { '-' * 40 } """ ), file = erf )
398405 quitting = True
399406 thread .interrupt_main ()
400407
0 commit comments