Closed kousu closed 6 years ago
And when doing this I came across progressbar.widgets.Bar.update which says:
if pbar.maxval:
marked *= int(pbar.currval / pbar.maxval * width)
which suggests to me that instead of UnknownLength it might be simpler just to declare maxval==None to mean the length is unknown (since 'if UnknownLength' passes the check and goes into the branch).
Or maybe the thing to do is to use float("NaN" as the "unknown" value, so that the calculations can be left in place, but detect it in the views and display it as blank space or "N/A" or whatever is appropriate.
Is there any interest in this or should I close the PR?
Sorry for the delay. I think I need to add some automated tests, verifying by hand is time consuming. I probably didn't have time to do right when you sent the pull request, then I ended up forgetting about it.
I have this code (on top of python-requests):
I want it to show me a percentage ticker if it can, but to gracefully fall back if the remote server doesn't send a Content-Length. But instead I get:
This patches this problem. I don't know if it's totally correct, but I would like to raise the issue.