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.
get_GEO('GPL1641')
fails withOSError: Download failed due to 'Downloaded size do not match the expected size for http://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 thatcontent-length
is the same as the size before encoding. This is not the case whencontent-encoding=gzip
because thencontent-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 bechunk_size
, except for the last chunk... Might be best to drop thecontent-length
enforcement.