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 steven.daprano
Recipients George Gillan, steven.daprano
Date 2017-07-11.01:16:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1499735800.63.0.899225940023.issue30894@psf.upfronthosting.co.za>
In-reply-to
Content
Before Python runs your code, it compiles it to byte-code. A SyntaxError means that the code cannot be compiled, and so it does not run.

So the SyntaxError is raised *before* any of the code runs, and standard error is not re-directed. This is expected behaviour, not a bug. You cannot catch compile-time errors at run-time.
History
Date User Action Args
2017-07-11 01:16:40steven.dapranosetrecipients: + steven.daprano, George Gillan
2017-07-11 01:16:40steven.dapranosetmessageid: <1499735800.63.0.899225940023.issue30894@psf.upfronthosting.co.za>
2017-07-11 01:16:40steven.dapranolinkissue30894 messages
2017-07-11 01:16:39steven.dapranocreate