-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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] Progress Display Overwrites Separate Console Output and Repeats Past Tasks #3086
Comments
You will need to use the same console object throughout your code if you want to combine printing with scrollbars. |
When I change |
I'm afraid I didn't follow that. You will need to use the same Console object. Please trust me over GPT. |
I didn't use 2 console objects at first, I used the downloader.py that you provided |
Now with the console object declaration deleted, the progress override is still there. I used python's print and console.print still. Everything works fine on the first page, when I call with progress:
await AwemeDownload(aweme_data) again, the output is overwritten and repeated |
The issue is most likely in your code, and not Rich itself. I suspect you are writing to stdout somewhere, and not going through the Progress console object. It could also be related to the way you have fixed the console width, rather than let Rich auto-detect it. If you need further help, please narrow down the problem to a short piece of code I can test against. |
I hope we solved your problem. If you like using Rich, you might also enjoy Textual |
So do I need to use progress.console.log to control the output, but I checked my code and the list given to copy_url has no duplicate tasks |
This worked for me. It turned out that my logging config was using stderror which caused the issue. I used logging.basicConfig(
format="%(message)s",
datefmt="[%X]",
handlers=[RichHandler(
console=console, rich_tracebacks=True, tracebacks_show_locals=True)],
) |
Describe the bug
When utilizing the
Progress
class from therich
library to showcase progress for downloading content across different pages, I've noticed repeated task outputs on my terminal. Specifically, as my program fetches and processes data from subsequent pages, the progress display seems to refresh and reflect past tasks. I've ensured there is no repetition in my data or within the tasks themselves inrich
.this is first-page download
When I step-by-step debugged it, I found that the page-flip download redraws the terminal causing a lot of duplicate output for many tasks
The task_ids and tasks are not duplicates.
To Reproduce
Part of the code uses the example's code https://github.com/Textualize/rich/blob/master/examples/downloader.py
A brief code snippet is as follows:
Another problem is that I'm using a different console object but progress still overwrites its output.
Expected behavior
Actual behavior
This is my project https://github.com/johnserf-seed/tiktokdownload
The text was updated successfully, but these errors were encountered: