summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/run.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-08-09 20:26:37 (GMT)
committerGitHub <noreply@github.com>2020-08-09 20:26:37 (GMT)
commit61f23cb62d6bdd72b61fc36abf4c1492493d71af (patch)
tree23bb3bf804def74a805dacd4aed1218b3af6d8c0 /Lib/idlelib/run.py
parentf421865c76a34a80c57350bcfbde664f4e80313d (diff)
downloadcpython-61f23cb62d6bdd72b61fc36abf4c1492493d71af.zip
cpython-61f23cb62d6bdd72b61fc36abf4c1492493d71af.tar.gz
cpython-61f23cb62d6bdd72b61fc36abf4c1492493d71af.tar.bz2
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 f2e161c27964a59bc5ab20d96f87ba5862c6222d) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Lib/idlelib/run.py')
-rw-r--r--Lib/idlelib/run.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
index 5bd84aa..1e84ecc 100644
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -387,14 +387,21 @@ class MyRPCServer(rpc.RPCServer):
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()