This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author twisteroid ambassador
Recipients Drew Budwin, asvetlov, twisteroid ambassador, yselivanov
Date 2019-04-16.05:53:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1555394016.95.0.370630220693.issue36636@roundup.psfhosted.org>
In-reply-to
Content
The difference is because you grabbed and print()ed the exception themselves in Script 2, while in Script 1 you let Python's built-in unhandled exception handler (sys.excepthook) print the traceback for you.

If you want a traceback, then you need to print it yourself. Try something along the lines of this:

    traceback.print_tb(result.__traceback__)

or:

    traceback.print_exception(type(result), result, result.__traceback__)

or if you use the logging module:

    logging.error('Unexpected exception', exc_info=result)


reference: https://stackoverflow.com/questions/11414894/extract-traceback-info-from-an-exception-object
History
Date User Action Args
2019-04-16 05:53:36twisteroid ambassadorsetrecipients: + twisteroid ambassador, asvetlov, yselivanov, Drew Budwin
2019-04-16 05:53:36twisteroid ambassadorsetmessageid: <1555394016.95.0.370630220693.issue36636@roundup.psfhosted.org>
2019-04-16 05:53:36twisteroid ambassadorlinkissue36636 messages
2019-04-16 05:53:36twisteroid ambassadorcreate