Skip to content
New issue

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

[BUG] #3361

Closed
2 tasks done
etiennepellegrini opened this issue May 17, 2024 · 3 comments
Closed
2 tasks done

[BUG] #3361

etiennepellegrini opened this issue May 17, 2024 · 3 comments

Comments

@etiennepellegrini
Copy link

Describe the bug

I believe the rich documentation should be updated.
It presents rich.print as a "drop-in replacement for print".

However, that statement is very misleading, as the developers themselves admit:

That is correct. There are a few other differences as well.
- #1366 (comment)

After spending several hours tracking down why my output files had extra line breaks, I really wish the differences with print were listed in the docs, instead of pretending to be a drop-in replacement.
I also would stop recommending people overload print, unless they want surprises later. Had I used from rich import print as rprint, I probably would have understood that rich was responsible much faster.

Thanks
Etienne

Platform

Click to expand

What platform (Win/Linux/Mac) are you running on? What terminal software are you using?
Linux

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
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── <class 'rich.console.Console'> ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ A high level console interface.                                                                                                                                                                                                                                            │
│                                                                                                                                                                                                                                                                            │
│ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ <console width=383 ColorSystem.EIGHT_BIT>                                                                                                                                                                                                                              │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                                                                                                                                                                            │
│     color_system = '256'                                                                                                                                                                                                                                                   │
│         encoding = 'utf-8'                                                                                                                                                                                                                                                 │
│             file = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>                                                                                                                                                                                           │
│           height = 69                                                                                                                                                                                                                                                      │
│    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=383, height=69), legacy_windows=False, min_width=1, max_width=383, is_terminal=True, encoding='utf-8', max_height=69, justify=None, overflow=None, no_wrap=False, highlight=None, markup=None, height=None) │
│            quiet = False                                                                                                                                                                                                                                                   │
│           record = False                                                                                                                                                                                                                                                   │
│         safe_box = True                                                                                                                                                                                                                                                    │
│             size = ConsoleDimensions(width=383, height=69)                                                                                                                                                                                                                 │
│        soft_wrap = False                                                                                                                                                                                                                                                   │
│           stderr = False                                                                                                                                                                                                                                                   │
│            style = None                                                                                                                                                                                                                                                    │
│         tab_size = 8                                                                                                                                                                                                                                                       │
│            width = 383                                                                                                                                                                                                                                                     │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─── <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"
$ pip freeze | grep rich
rich==13.7.0
Copy link

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

@willmcgugan
Copy link
Collaborator

Open source maintainers aren't here to listen to you vent.

I'm closing this issue. If you want to try again, without blaming anyone for your misunderstanding, I will consider your request.

@willmcgugan willmcgugan closed this as not planned Won't fix, can't repro, duplicate, stale May 17, 2024
Copy link

I hope we solved your problem.

If you like using Rich, you might also enjoy Textual

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants