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

download fails because of content-length mismatch when content-encoding=gzip #80

Open
vttrifonov opened this issue Jan 7, 2022 · 1 comment

Comments

@vttrifonov
Copy link

get_GEO('GPL1641') fails with

OSError: Download failed due to 'Downloaded size do not match the expected size for https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?targ=self&acc=GPL16417&form=text&view=full'. ID could be incorrect or the data might not be public yet.

The issue is that Downloader._download_http assumes that content-length is the same as the size before encoding. This is not the case when content-encoding=gzip because then content-length is the compressed size (i.e. after encoding/compression).

It is not clear how to get the size of the chunk before decoding/decompression unless you want to deal with the raw stream directly: it will be chunk_size, except for the last chunk... Might be best to drop the content-length enforcement.

@bionewplayer
Copy link

you can try this code "os.environ['GEOPARSE_USE_HTTP_FOR_FTP'] = 'yes'" before get_GEO('GPL1641')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants