question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Alive_bar crashes when using bar.text with disabled and dual_line options set to True

See original GitHub issue

Hi rsalmei, check out this code:

from alive_progress import alive_bar
import time

with alive_bar(1000, disable=True, dual_line=True) as bar:
    for i in range(1000):
        bar.text(f"Iteration no. {i}")
        time.sleep(.005)
        bar()

When I run it, I get this error:

Traceback (most recent call last):
  File "/home/jplopes/dev/Test-Houses/proto_alive.py", line 6, in <module>
    bar.text(f"Iteration no. {i}")
  File "/home/jplopes/dev/Test-Houses/.venv/lib/python3.10/site-packages/alive_progress/core/progress.py", line 141, in set_text
    run.text, run.suffix = ('\n', to_cells(str(text))), term.cursor_up_1.sequence
AttributeError: 'function' object has no attribute 'sequence'

which traces back to line 141 of alive_progress/core/progress.py:

if text and config.dual_line:
    run.text, run.suffix = ('\n', to_cells(str(text))), term.cursor_up_1.sequence

only triggered when using bar.text with dual_line=True configuration.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
rsalmeicommented, Apr 1, 2022

Yeah, regarding @cpiment, I’d ask you to open an issue for that. I think it is not related to this at all.

1reaction
rsalmeicommented, Apr 1, 2022

Hello @jhonatan-lopes! Nice catch, this term.sequence field is new, I’ve introduced it exactly for the dual-line mode, and this detail has slipped me. I’ll release it now, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

rsalmei/alive-progress: A new kind of Progress Bar ...
A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations! ... Now, alive_bar supports Dual Line text mode!
Read more >
Why is my add-in crashing?
When an add-in that isn't designed to function in a DEP-enabled environment tries to run, the Office program you're using stops working (crashes)...
Read more >
'Destiny 2' text chat disabled due to game-crashing PvP ...
Bungie has announced that text chat in 'Destiny 2' has been "temporarily disabled," after an exploit was being abused for free PvP wins....
Read more >
Issues - alive-progress - rsalmei - Repos
A new kind of Progress Bar, with real-time throughput, ETA, and very cool ... Alive_bar crashes when using bar.text with disabled and dual_line...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found