Message 291230 - Python tracker (original) (raw)

In the OP, the error is caused by open being unavailable, which is a builtin. According to what Serhiy says, this error would be after step 6 in his list, so sys wouldn't be available either, and nor perhaps would any other builtins.

As some termination issues are asyncio-related (e.g. this one, "coroutine was never awaited"), it would make more sense for this kind of error handling to happen there - there's more contextual information available than there is in logging, so the error message displayed would be more useful because it could use the additional context available.