Fix fallback for errors in logging #3013
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the bug identified in #3012, in which the catch block that's supposed to save you in case an error is thrown during logging ends up throwing an error of its own.
original_stderr
is now assigned at runtime through the module's__init__
function, not at compile time as a hardcoded global constant. This was the source of the bug.@error
log, which stands out more with the red frame and also looks more consistent with the other information logged to the REPL by Pluto.Having looked more deeply at #3012, I think this PR is a sufficient fix on the Pluto side. The reason GPUCompiler's log messages error in the first place is that the purportedly safe logging macros are implemented incorrectly and aren't actually safe. I'll put together a PR to GPUCompiler for that.