-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[BUG] number of bytes exceeds in rich's wrap_file() function #2307
Comments
The most likely explanation is that your |
thnx! that works, i think this issue can now be closed. but do u know a way through which i can always get |
Did I solve your problem? Why not buy the devs a coffee to say thanks? |
Not all web-servers return the Content-Length I'm afraid. Sometimes the server doesn't know in advance how large the file is, or doesn't report it for some other reason. |
Content-Length will be dropped on some servers as they will compress certain file types with one of them being .txt files where the server will gzip the stream, and the file size is unknown. You can disable the gzip process by adding the "Accept-Encoding": None option within your request header, The following is fairly typical of what I use: Alternately in the absence of a Content_length substitute a spinner or something for the progress bar if you want the gzip file (but remember to append .gzip so people realise what it is |
i am using rich's progress bars to show download progress of files, even though the number of bytes always exceeds the "Content-Length" the file is downloaded perfectly. following is my code:
The text was updated successfully, but these errors were encountered: