Skip to content
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

Progress bar display does not update #154

Closed
durana opened this issue Feb 12, 2018 · 6 comments
Closed

Progress bar display does not update #154

durana opened this issue Feb 12, 2018 · 6 comments

Comments

@durana
Copy link

durana commented Feb 12, 2018

Description

I found with the latest version on PyPI, 3.35.0, that a progress bar's display does not get updated until the end when it is finished. I tested with the 3.34.3 version from PyPI, and this version updates the progress bar's display as expected.

Code

#!/usr/bin/env python

import time
import progressbar

bar = progressbar.ProgressBar()
for i in bar(range(100)):
    time.sleep(0.02)

Versions

  • Python version:
3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
  • Python distribution/environment: Anaconda
  • Operating System: macOS
  • Package version: 3.35.0
@JoeSc
Copy link
Contributor

JoeSc commented Feb 12, 2018

I have the same issue, simple example like

import time
import progressbar

bar = progressbar.ProgressBar()
for i in bar(range(100)):
    time.sleep(0.02)

does not update. I bisected to 572854d

it appears the issue is with the update_delta near line 569 of bar.py

@wolph
Copy link
Owner

wolph commented Feb 12, 2018 via email

wolph added a commit that referenced this issue Feb 13, 2018
Fixed bug #154 which caused the progressbar not too update often enough
@wolph
Copy link
Owner

wolph commented Feb 13, 2018

Thanks for the help everyone, I've released a new version which fixes the issue

@wolph wolph closed this as completed Feb 13, 2018
@JoeSc
Copy link
Contributor

JoeSc commented Feb 13, 2018

It seems there's still issues, Using this example code results in the progressbar from jumping from 2% to 100%.

import time
import progressbar

bar = progressbar.ProgressBar()
for i in bar(range(1000)):
    time.sleep(0.001)

See behavior here in this terminal recording
https://asciinema.org/a/qNiqvZyx85lwQUGAJ6titcLWk

The recording shows me running simple.py at the current HEAD and then reverting both e664f04 and 572854d. After reverting it runs as expected with the progressbar progressing across the screen to 100%

@JoeSc
Copy link
Contributor

JoeSc commented Feb 13, 2018

I'm not quite sure how the underlying code works, but this change seems to fix the progressbar
https://gist.github.com/JoeSc/ef01c281318d99605ad4b49668f2b503

@wolph
Copy link
Owner

wolph commented Feb 14, 2018

Thanks for the help guys, unfortunately this type of bug is hard to test for but I've put out a new release with the fixes similar to @JoeSc's changes :)

JoeSc pushed a commit to JoeSc/python-progressbar that referenced this issue Feb 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants