From e6147444ac4ae43364fbb3a08f41052e34352201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Gim=C3=A9nez=20de=20Castro?= Date: Thu, 24 Aug 2023 11:16:34 +0200 Subject: [PATCH] Implement Bruno's fix --- bin/autosubmit | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/autosubmit b/bin/autosubmit index bc18d5431..d3775fbb1 100755 --- a/bin/autosubmit +++ b/bin/autosubmit @@ -21,6 +21,7 @@ import os import sys import traceback +from io import StringIO # for handling the traceback print scriptdir = os.path.abspath(os.path.dirname(sys.argv[0])) sys.path.append(scriptdir) @@ -64,9 +65,9 @@ def main(): Log.critical( "{0}\nAnother instance of autosubmit is running on this experiment. If this is not the case, delete autosubmit.lock".format(str(e)), 7000) else: - Log.critical( - "{1}{0}\nUnhandled error: If you see this message, please report it in Autosubmit's GitLab project".format(str(e),str(traceback.print_exc()) -), 7000) + exception_stream = StringIO() + traceback.print_exc(file=exception_stream) + Log.critical("{1}{0}\nUnhandled error: If you see this message, please report it in Autosubmit's GitLab project".format(str(e),exception_stream.getvalue()), 7000) os._exit(1) -- GitLab