{"action":"opened","issue":{"url":"https://api.github.com/repos/WoLpH/python-progressbar/issues/54","repository_url":"https://api.github.com/repos/WoLpH/python-progressbar","labels_url":"https://api.github.com/repos/WoLpH/python-progressbar/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/WoLpH/python-progressbar/issues/54/comments","events_url":"https://api.github.com/repos/WoLpH/python-progressbar/issues/54/events","html_url":"https://github.com/WoLpH/python-progressbar/issues/54","id":133911353,"number":54,"title":"progressbar deos not finish in some cases","user":{"login":"nescioz","id":7439694,"avatar_url":"https://avatars.githubusercontent.com/u/7439694?v=3","gravatar_id":"","url":"https://api.github.com/users/nescioz","html_url":"https://github.com/nescioz","followers_url":"https://api.github.com/users/nescioz/followers","following_url":"https://api.github.com/users/nescioz/following{/other_user}","gists_url":"https://api.github.com/users/nescioz/gists{/gist_id}","starred_url":"https://api.github.com/users/nescioz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nescioz/subscriptions","organizations_url":"https://api.github.com/users/nescioz/orgs","repos_url":"https://api.github.com/users/nescioz/repos","events_url":"https://api.github.com/users/nescioz/events{/privacy}","received_events_url":"https://api.github.com/users/nescioz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-16T08:03:29Z","updated_at":"2016-02-16T08:03:29Z","closed_at":null,"body":"sometimes even if updating the progressbar with the max_value, the progressbar does not finish with 100%. \r\n\r\nThis is due to the following logic in `_needs_update` method:\r\n\r\n        if self.poll_interval:\r\n            delta = datetime.now() - self.last_update_time\r\n            poll_status = delta > self.poll_interval\r\n\r\n        # Do not update if value increment is not large enough to\r\n        # add more bars to progressbar (according to current\r\n        # terminal width)\r\n        try:\r\n            divisor = self.max_value / self.term_width  # float division\r\n            if self.value // divisor == self.previous_value // divisor:\r\n                if self.poll_interval:\r\n                    return poll_status\r\n                return False\r\n        except:\r\n            # ignore any division errors\r\n            pass\r\n\r\n        if self.value > self.next_update or self.end_time:\r\n            return True\r\n        elif self.poll_interval:\r\n            return poll_status\r\n\r\neven if updating with max_value, the method still returns False if the increment is not large enough.\r\nsuggest add the logic that returns True when max_value is reached."}}