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

Allow the content-length header to be missing #194

Closed
davehunt opened this issue Jan 24, 2014 · 4 comments
Closed

Allow the content-length header to be missing #194

davehunt opened this issue Jan 24, 2014 · 4 comments

Comments

@davehunt
Copy link
Member

Currently we fail if the content-length header is not present:

$ mozdownload --url=https://github.com/status
INFO | Downloading from: https://github.com/status
Traceback (most recent call last):
File "/Users/dhunt/.virtualenvs/mozdownload/bin/mozdownload", line 8, in
load_entry_point('mozdownload==1.10', 'console_scripts', 'mozdownload')()
File "/Users/dhunt/workspace/mozdownload/mozdownload/scraper.py", line 1016, in cli
build.download()
File "/Users/dhunt/workspace/mozdownload/mozdownload/scraper.py", line 277, in download
total_size = int(r.headers.get('Content-length').strip())
AttributeError: 'NoneType' object has no attribute 'strip'

We need a test and a fix for this.

@whimboo
Copy link
Contributor

whimboo commented Jan 27, 2014

Good catch. I hope that we don't have to do too much workarounds for the progress bar to be working. @Nebelhom, mind having a look at, given that you mostly implemented this code?

@Nebelhom
Copy link
Collaborator

@whimboo @davehunt

What should be the expected behaviour in this instance?

@davehunt
Copy link
Member Author

We shouldn't throw an exception. We should download the file. :)

@whimboo
Copy link
Contributor

whimboo commented May 23, 2014

PR #198 has been fixed. Thanks!

@whimboo whimboo closed this as completed May 23, 2014
@whimboo whimboo added this to the 1.12 milestone Sep 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants