-
Notifications
You must be signed in to change notification settings - Fork 76
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
error downloading file from sub-directory in zenodo repository #336
Comments
Hi @djmannion! Thanks for opening this issue. This is definitely a bug, although a one we haven't anticipated. Zenodo doesn't allow you to upload directories with files inside, only files (in the strict sense of the word). This is why we usually upload zip files if we want our content to have some hierarchy. So, the problem is that for some reason it allowed to upload a file with a forward slash in its name: The JSON that Zenodo offers through its API was helpful to identify this: https://zenodo.org/api/records/7352326 (check under This behaviour is tricky to support. In the current release of Pooch ( In your case, the filename actually has a slash what breaks the previous workflow, now the url can follow I've opened a PR to add support to filenames with slashes. I'll ping you there! |
Hi @santisoler! Thanks very much for looking into it. That's very interesting about the forward-slash in the filename - I hadn't considered that. Looking at a few other zenodo repositories, it seems to be encountered quite frequently (e.g., https://zenodo.org/record/7524976, https://zenodo.org/record/7517342, https://zenodo.org/record/7581649). A common element seems to be github integration - it seems like data that is formed from a github release has the github username then a forward-slash prepended to the release filename. |
I see. Well in that case we be sure to fully support it. And it makes sense that these files aren't uploaded through the webapp, but through API interaction. |
Description of the problem:
Thanks very much for this very useful project!
I'm trying to download a file from the zenodo repository at
doi:10.5281/zenodo.7352326
(link). The file name isGreatApeDictionary-v1.1.zip
and it seems to be in aWild-Minds
sub-directory in the repository. I receive an error that the file is "not found in data archive" (see below for full error message).Looking in the
pooch/downloaders.py
code (v1.6.0
), it seems that thefiles
information that is returned by the zenodo API has the filename asWild-Minds/GreatApeDictionary-v1.1.zip
- but the file name that is passed to the downloader is the last item of asplit("/")
operation and so loses theWild-Milds
part. If I replace the linefile_name=parsed_url["path"].split("/")[-1],
withfile_name="/".join(parsed_url["path"].split("/")[1:]),
then it seems to work fine.I noticed that the code has changed in the current git version, so I tried that also (
v1.6.0.post16+gf20fe3a
). I get a different error:ValueError: Archive with doi:10.5281/zenodo.7347607/Wild-Minds not found (see https://doi.org/10.5281/zenodo.7347607/Wild-Minds). Is the DOI correct?
- so the sub-directory seems to be being included as part of the DOI.Apologies if I have just missed something - thanks for any assistance.
Full code that generated the error
Full error message
System information
The text was updated successfully, but these errors were encountered: