Monochrome Rich traceback rendering w/ ConsoleRenderer(colors=False)#794
Open
funkyfuture wants to merge 2 commits intohynek:mainfrom
Open
Monochrome Rich traceback rendering w/ ConsoleRenderer(colors=False)#794funkyfuture wants to merge 2 commits intohynek:mainfrom
funkyfuture wants to merge 2 commits intohynek:mainfrom
Conversation
d210f4e to
1924e3e
Compare
Author
|
if this is of interest for you, i could use some advice. the test i added executes unreliably within the tox environments locally. and i have no clue why. |
Owner
|
on a brief look your conceptual problem seems to be that setting colors does nothing on ConsoleRenderer. It's only an argument to the constructor that sets up columns a certain way. You're also modifying a global shared object so it's to be expected that you get weird side-effects. You probably want to create something like |
4a05d1c to
e019d4b
Compare
Author
|
thanks for the hint! improperly fiddling w/ global objects was the cause. |
…e output The None isn't specified as Literal, b/c ruff tells us how to express this.
e019d4b to
972dabc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
As addressed in this SO question, exceptions are logged with colours when using the
ConsoleRendererwith the default rich exception formatter even when the renderer was initialized w/colors=False.This patch selects monochrome output for that formatter when it's used as default.
Pull Request Check List
mainbranch.api.py.docs/api.rstby hand.versionadded,versionchanged, ordeprecateddirectives..rstand.mdfiles is written using semantic newlines.