MRG, FIX: Fix fetching bugs#7378
Merged
agramfort merged 1 commit intomne-tools:masterfrom Mar 4, 2020
Merged
Conversation
Member
Author
|
CircleCI failure is a likely memory problem in either |
Member
|
provided Circle CI failure is unrelated LGTM. MErging. thx @larsoner |
AdoNunes
pushed a commit
to AdoNunes/mne-python
that referenced
this pull request
Apr 6, 2020
AdoNunes
pushed a commit
to AdoNunes/mne-python
that referenced
this pull request
Apr 6, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In maybe 10% of PRs we get sporadic failures downloading the test data or in
test_constants.pyof the form:I could replicate it locally by running
pytest mne/io/tests/test_constants.pya lot (like 10-20 times) -- I'd see the failure every once in a while.This has to do with our not handling
chunkeddata protocol properly. The chunked protocol causes theheaders['Content-Length']to be None/missing, which we currently treat as a file size of1but then later don't handle properly. We can and should still read data even if we don't know the total size rather than fail out. This PR simplifies a lot of the logic in our downloader in order hopefully to help. It also reduces the number of times that we open URLs to get information from them (hopefully it's only once now).I simplified our code for following redirects, under the assumption that modern Python will not require us to go through and manually follow multiple redirects. In testing it seems okay and
nilearn(where we originally adapted our code) does not even try to do this, so I think it'll be okay. I'm running with[circle full]just to test all of our downloads, though.