mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	bpo-41468: Improve and test IDLE run error exit (GH-21798)
A message box pops up when an unexpected error stops the run process.  Tell users it is likely a random glitch, but report it if not.
(cherry picked from commit f2e161c279)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
			
			
This commit is contained in:
		
							parent
							
								
									6860cf5387
								
							
						
					
					
						commit
						a9fa66377f
					
				
					 4 changed files with 49 additions and 10 deletions
				
			
		|  | @ -387,14 +387,21 @@ def handle_error(self, request, client_address): | |||
|             thread.interrupt_main() | ||||
|         except: | ||||
|             erf = sys.__stderr__ | ||||
|             print('\n' + '-'*40, file=erf) | ||||
|             print('Unhandled server exception!', file=erf) | ||||
|             print('Thread: %s' % threading.current_thread().name, file=erf) | ||||
|             print('Client Address: ', client_address, file=erf) | ||||
|             print('Request: ', repr(request), file=erf) | ||||
|             traceback.print_exc(file=erf) | ||||
|             print('\n*** Unrecoverable, server exiting!', file=erf) | ||||
|             print('-'*40, file=erf) | ||||
|             print(textwrap.dedent(f""" | ||||
|             {'-'*40} | ||||
|             Unhandled exception in user code execution server!' | ||||
|             Thread: {threading.current_thread().name} | ||||
|             IDLE Client Address: {client_address} | ||||
|             Request: {request!r} | ||||
|             """), file=erf) | ||||
|             traceback.print_exc(limit=-20, file=erf) | ||||
|             print(textwrap.dedent(f""" | ||||
|             *** Unrecoverable, server exiting! | ||||
| 
 | ||||
|             Users should never see this message; it is likely transient. | ||||
|             If this recurs, report this with a copy of the message | ||||
|             and an explanation of how to make it repeat. | ||||
|             {'-'*40}"""), file=erf) | ||||
|             quitting = True | ||||
|             thread.interrupt_main() | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Miss Islington (bot)
						Miss Islington (bot)