Description
Using formatting with Timer(), AdaptiveETA(), and possibly other time widgets causes all formatting to stop working, and instead print this to the terminal over and over again, followed by the marker given.
Time: 0:00:05Time passed: {'max_value': 100, 'start_time': datetime.datetime(2022, 8, 28, 22, 9, 45, 398765), 'last_update_time': datetime.datetime(2022, 8, 28, 22, 9, 51, 243406), 'end_time': datetime.datetime(2022, 8, 28, 22, 9, 51, 243406), 'value': 100, 'previous_value': 6, 'updates': 7, 'total_seconds_elapsed': 5.844641, 'seconds_elapsed': 5.844641, 'minutes_elapsed': 0.08333333333333333, 'hours_elapsed': 0.001388888888888889, 'days_elapsed': 5.787037037037037e-05, 'time_elapsed': datetime.timedelta(seconds=5, microseconds=844641), 'percentage': 100.0, 'variables': {}, 'dynamic_messages': {}, 'eta_seconds': 0.0, 'eta': None, 'finished': datetime.datetime(2022, 8, 28, 22, 9, 51, 243406), 'last_update': datetime.datetime(2022, 8, 28, 22, 9, 51, 243406), 'max': 100, 'seconds': 5.844641, 'start': datetime.datetime(2022, 8, 28, 22, 9, 45, 398765), 'elapsed': '0:00:05'}||
Using the widgets without a format specified as an argument works as expected. For example, the code below works as normal.
import progressbar as pb
import time
widgets = [
pb.AdaptiveETA(),
pb.Timer(),
pb.Bar()
]
progBar = pb.ProgressBar(widgets=widgets, max_value=100).start()
for i in range(1, 101):
progBar.update(i)
time.sleep(0.1)
...But the code below prints the output shown above.
import progressbar as pb
import time
widgets = [
pb.AdaptiveETA(format="Time left: %s"),
pb.Timer(),
pb.Bar()
]
progBar = pb.ProgressBar(widgets=widgets, max_value=100).start()
for i in range(1, 101):
progBar.update(i)
time.sleep(0.1)
This issue only started happening when I used pip install progressbar2. Before I had only used pip install progressbar, and everything worked as expected.
Code
See above.
As mentioned, this code reproduces the issue:
import progressbar as pb
import time
widgets = [
pb.AdaptiveETA(format="Time left: %s"),
pb.Timer(format="Time passed: %s"),
pb.Bar()
]
progBar = pb.ProgressBar(widgets=widgets, max_value=100).start()
for i in range(1, 101):
progBar.update(i)
time.sleep(0.1)
Versions
- Python version: 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
- Python distribution/environment: Python 3.10 running in a powershell terminal.
- Operating System: Windows 11
- Package version: 4.0.0
Description
Using formatting with
Timer(),AdaptiveETA(), and possibly other time widgets causes all formatting to stop working, and instead print this to the terminal over and over again, followed by the marker given.Using the widgets without a format specified as an argument works as expected. For example, the code below works as normal.
...But the code below prints the output shown above.
This issue only started happening when I used
pip install progressbar2. Before I had only usedpip install progressbar, and everything worked as expected.Code
See above.
As mentioned, this code reproduces the issue:
Versions