Closed mbjoseph closed 5 years ago
An update: I noticed now that I can get this to work for data on fig share by not providing a URL directly to the file, e.g.,
d.get_data(url='https://ndownloader.figshare.com/files/7010681') # works
rather than
d.get_data(url='https://ndownloader.figshare.com/files/7010681.zip') # does not work
I'm going to close this, and will update the docs & tests to reflect this intended usage.
Describe the bug
The use of the
url
argument to theget_data
method of theEarthlabData
class seems to not be working. I have tried a variety of URLs that point to different kinds of files and I always get aKeyError
when trying to access thecontent-disposition
field in the header of the response.To Reproduce
Using a URL to a zip file raises the
KeyError
.This happens for every URL that I have tried so far, including:
Expected behavior
I would expect that for valid data types (e.g., files, zip files, tar, and tar.gz files), those files would be downloaded and I would get the path(s) to the data.
What Operating System Are you Running?
DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=bionic DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"
Additional context
After digging into this more, it looks like the
content-disposition
is not returned in the responses to any of the above requests, and I can't find an equivalent part of the returned header that can be used to determine the file name. Maybe I'm missing something, or using theurl
argument incorrectly. @betatim might know.For example:
which returns