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 aroberge
Recipients aroberge, terry.reedy
Date 2021-06-20.09:36:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I just thought of making a copy of the file content under a known name as the least disruptive approach for IDLE's code - even less so than the recent addition required to support user-defined exception hooks.

For SyntaxErrors and subclasses [1], Friendly needs the source code as well as the error message, offset, lineno (end_offset and end_lineno if they are present) in order to perform its analysis. In all cases (i.e not only with IDLE but with other environments like Jupyter notebooks), it retrieves this source code from the given filename using the linecache module.  

If it were possible to get those exception arguments using RPC, this would be much better than what I suggested. This might also be much more useful that what I suggest for any third-party code wanting access to the traceback information for SyntaxErrors. However, I could not find a simple way of doing this.

[1] The required information for run-time errors, such as NameError, etc., is already available with sys.excepthook.
Date User Action Args
2021-06-20 09:36:04arobergesetrecipients: + aroberge, terry.reedy
2021-06-20 09:36:04arobergesetmessageid: <>
2021-06-20 09:36:04arobergelinkissue43476 messages
2021-06-20 09:36:04arobergecreate