-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Describe the bug
Since upgrading to Rich 10.15.1 I am seeing my test suites randomly get stuck. So far I have only noticed this when running tests and have not seen it when running programs outside of the tests. Here is one example. This issue is also happening in the Rich test suite (example here). The tests stop on the pytest step and never make any progress until GitHub Actions eventually time out.
I have also been able to reproduce this locally so it is not specific to GitHub Actions only. If I stop the tests with ctrl + c locally I get the following error (the full stack trace is really long so I'm only posting the last error, if more will help I can post it):
self = <console width=209 None>, live = <rich.live.Live object at 0x7f56051da200>
def set_live(self, live: "Live") -> None:
"""Set Live instance. Used by Live context manager.
Args:
live (Live): Live instance using this Console.
Raises:
errors.LiveError: If this Console has a Live context currently active.
"""
with self._lock:
if self._live is not None:
> raise errors.LiveError("Only one live display may be active at once")
E rich.errors.LiveError: Only one live display may be active at once
.venv/lib/python3.10/site-packages/rich/console.py:813: LiveErrorAs far as I can tell the issue is random. It happens frequently, but I haven't been able to find a way to guarantee it happens.
Platform
Locally I am using Linux, but in GitHub Actions I have see the issue on Linux, Mac, and Windows.
I may ask you to cut and paste the output of the following commands. It may save some time if you do it now.
python -m rich.diagnose
╭───────────────────────── <class 'rich.console.Console'> ─────────────────────────╮
│ A high level console interface. │
│ │
│ ╭──────────────────────────────────────────────────────────────────────────────╮ │
│ │ <console width=209 ColorSystem.TRUECOLOR> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ color_system = 'truecolor' │
│ encoding = 'utf-8' │
│ file = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'> │
│ height = 50 │
│ 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=209, height=50), │
│ legacy_windows=False, │
│ min_width=1, │
│ max_width=209, │
│ is_terminal=True, │
│ encoding='utf-8', │
│ max_height=50, │
│ justify=None, │
│ overflow=None, │
│ no_wrap=False, │
│ highlight=None, │
│ markup=None, │
│ height=None │
│ ) │
│ quiet = False │
│ record = False │
│ safe_box = True │
│ size = ConsoleDimensions(width=209, height=50) │
│ soft_wrap = False │
│ stderr = False │
│ style = None │
│ tab_size = 8 │
│ width = 209 │
╰──────────────────────────────────────────────────────────────────────────────────python -m rich._windows
platform="Linux"
WindowsConsoleFeatures(vt=False, truecolor=False)pip freeze | grep rich
rich 10.15.1 Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal