-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ANSI escape codes break tqdm.tqdm.write
formatting
#777
Comments
* Limit the maximum usable version of tqdm as a temporary workaround for tqdm/tqdm#777 Change-Id: Id616117aac1c0d8c628dd8edaa5412acd5f121fa
I'm experiencing the same issue in v4.45.0 when using a single progress bar. Extra line feeds get inserted for writes if color codes are used in the progress bar, using the workaround above, specifying the older version fixes it.
output looks like this. something |
The logger output has been replaced by a more user friendly and more pretty output. The colorama package is used to provide colour output on both Windows and Mac/Linux. The tqdm package is used to display progress bars while the accounting tool is progressing transactions. Due to an issue with tqdm (tqdm/tqdm#777) which creates extra new lines if any additional output is made during the progress bar, the setup.py has the tqdm package set to 'tqdm>=4.11.2,<4.25.0' as a workaround. A progress "spinner" has also been added while the PDF report is being generated as this can be slow for large amounts of data. The logger is no longer used.
tqdm.tqdm.write
formatting
duplicate of #692 |
Release v4.48.1 fixed the issue so the workaround is no longer required.
read the known issues
environment, where applicable: can repro since tqdm release
4.25.0
( ignore ANSI escape codes in the bar length calculation #592 ) up to the latest release (4.32.2
as of the opening of this issue).I'm aware that there are various efforts to improve existing issues related to
write()
( #737 ) and to multiple progress bars, but I'd like to report that since tqdm release4.25.0
and in particular change #592 a previously working code is now visually broken when colors are used.Pre-
4.25.0
behaviour:Since
4.25.0
(scroll all to the right):To see the colors and also the effect on a normally-sized shell see the attached screenshot:
As soon as I either remove any color from
bar_format
or revertto
everything works back again as before, with the small issue of the progress bars being shorter. CC @jnhansen as was involved in the related change.
If instead of removing the colors I remove the second progress bar this happens (again scroll all to the right):
Please advice if there is any workaround that I can use to have those two progress bars working with recent versions of tqdm.
The text was updated successfully, but these errors were encountered: