We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
While using rich.progress.track configured with a Console instantiated with stderr=True, print statements also go to stderr.
rich.progress.track
Console
stderr=True
I would expect rich to not hijack the default behavior of print.
rich
print
I understand I myself can use console.print() in my own code but I have no control over 3rd party plugins or libraries.
console.print()
Provide a minimal code example that demonstrates the issue if you can. If the issue is visual in nature, consider posting a screenshot.
#!/usr/bin/env python from rich.console import Console from rich.progress import track err_console = Console(stderr=True) console = Console() if __name__ == "__main__": for i in track(range(10), console=err_console): if i % 4 == 0: print(f"foo {i}") for i in range(10, 20): if i % 4 == 0: print(f"foo {i}")
Platform
What platform (Win/Linux/Mac) are you running on? What terminal software are you using? I may ask you to copy and paste the output of the following commands. It may save some time if you do it now. If you're using Rich in a terminal: python -m rich.diagnose pip freeze | grep rich
What platform (Win/Linux/Mac) are you running on? What terminal software are you using?
I may ask you to copy and paste the output of the following commands. It may save some time if you do it now.
If you're using Rich in a terminal:
python -m rich.diagnose pip freeze | grep rich
Linux VM via WSL2.
╰─▪ python -m rich.diagnose ╭─────────────────────── <class 'rich.console.Console'> ───────────────────────╮ │ A high level console interface. │ │ │ │ ╭──────────────────────────────────────────────────────────────────────────╮ │ │ │ <console width=80 ColorSystem.EIGHT_BIT> │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ color_system = '256' │ │ encoding = 'utf-8' │ │ file = <_io.TextIOWrapper name='<stdout>' mode='w' │ │ encoding='utf-8'> │ │ height = 41 │ │ is_alt_screen = False │ │ is_dumb_terminal = False │ │ is_interactive = True │ │ is_jupyter = False │ │ is_terminal = True │ │ legacy_windows = False │ │ no_color = False │ │ options = ConsoleOptions( │ │ size=ConsoleDimensions(width=80, height=41), │ │ legacy_windows=False, │ │ min_width=1, │ │ max_width=80, │ │ is_terminal=True, │ │ encoding='utf-8', │ │ max_height=41, │ │ justify=None, │ │ overflow=None, │ │ no_wrap=False, │ │ highlight=None, │ │ markup=None, │ │ height=None │ │ ) │ │ quiet = False │ │ record = False │ │ safe_box = True │ │ size = ConsoleDimensions(width=80, height=41) │ │ soft_wrap = False │ │ stderr = False │ │ style = None │ │ tab_size = 8 │ │ width = 80 │ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭─── <class 'rich._windows.WindowsConsoleFeatures'> ────╮ │ Windows features available. │ │ │ │ ╭───────────────────────────────────────────────────╮ │ │ │ WindowsConsoleFeatures(vt=False, truecolor=False) │ │ │ ╰───────────────────────────────────────────────────╯ │ │ │ │ truecolor = False │ │ vt = False │ ╰───────────────────────────────────────────────────────╯ ╭────── Environment Variables ───────╮ │ { │ │ 'TERM': 'xterm-256color', │ │ 'COLORTERM': None, │ │ 'CLICOLOR': None, │ │ 'NO_COLOR': None, │ │ 'TERM_PROGRAM': None, │ │ 'COLUMNS': None, │ │ 'LINES': None, │ │ 'JUPYTER_COLUMNS': None, │ │ 'JUPYTER_LINES': None, │ │ 'JPY_PARENT_PID': None, │ │ 'VSCODE_VERBOSE_LOGGING': None │ │ } │ ╰────────────────────────────────────╯ platform="Linux"
The text was updated successfully, but these errors were encountered:
We found the following entry in the FAQ which you may find helpful:
Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.
This is an automated reply, generated by FAQtory
Sorry, something went wrong.
No branches or pull requests
Describe the bug
While using
rich.progress.track
configured with aConsole
instantiated withstderr=True
, print statements also go to stderr.I would expect
rich
to not hijack the default behavior ofprint
.I understand I myself can use
console.print()
in my own code but I have no control over 3rd party plugins or libraries.Platform
Click to expand
Linux VM via WSL2.
The text was updated successfully, but these errors were encountered: