Fix missing URLError import statement #395
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi all, I found that there was a missing import statement in
datasets/utils.py
so if there is an error while downloading a sofa file the code raises an exception saying thatURLError
is not found instead of either skipping silently or re-raising the exception. So here is a tiny PR to fix this. I've also took the liberty to base the re-raised exception on the caught one to keep the original error message in the new exception, as it might give the end user insight on why the URL request failed.This is my first PR for this repo so please let me know if it needs some changes in code style or whatever 🙂
That also lead me to some other observations about the whole handling of SOFA files: why are some files directly included in the repo and some other are missing and must be fetched remotely? Maybe it would make sense to leave the user the choice at the moment of creating the SOFA database which are the files that they will actually need? In my case I only needed to access the files that were already part of the library when you install it but I was still blocked because of this failing URL request. If those questions are out of scope for this PR let me know and I'll open a separate issue to discuss it 🙂