Wrong first step when using context manager · Issue #161 · wolph/python-progressbar · GitHub
Skip to content

Wrong first step when using context manager #161

Description

@davidparsson

Description

When running the progress bar as a context manager, it skips step 1. In the example below it only shows step 0, 2, 3, and 3 is shown before it's completed. Running the code below should make it more obvious, if my explanation is unclear.

This only seems to be an issue when using the context manager.

Code

import time
import progressbar

with progressbar.ProgressBar(redirect_stdout=True) as progress:
    for i in progress(range(3)):
        time.sleep(1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions