download_files_in_parallel with cache=False doesn't work on Windows
See original GitHub issueIn #6658 I had problems locally with cache=False
. For example:
from astropy.utils.data import download_files_in_parallel
import os
dwn = download_files_in_parallel(['http://www.google.de', 'http://www.wikipedia.org'])
assert all([os.path.isfile(f) for f in dwn]), dwn
This fails locally - while it works if one just adds cache=True
:
from astropy.utils.data import download_files_in_parallel
import os
dwn = download_files_in_parallel(['http://www.google.de', 'http://www.wikipedia.org'], cache=True)
assert all([os.path.isfile(f) for f in dwn]), dwn
Could be a Windows-thing with subprocesses that remove temp-files created upon exit. But I don’t have the experience to make more than guesses. Would be interesting to know if that’s a fundamental problem with that function or just a Windows thing.
Issue Analytics
- State:
- Created 6 years ago
- Comments:22 (22 by maintainers)
Top Results From Across the Web
Internet Explorer file downloads over SSL do not work with the ...
This issue occurs if the server sends a "Cache-control:no-store" header or sends a "Cache-control:no-cache" header. Resolution. Important This section, method, ...
Read more >Caching in GitLab CI/CD
A cache is one or more files a job downloads and saves. Subsequent jobs that use the same cache don't have to download...
Read more >Caching dependencies to speed up workflows - GitHub Docs
Use caching when you want to reuse files that don't change often between jobs or workflow runs, such as build dependencies from a...
Read more >Download multiple files with a single action - Stack Overflow
I am working with many file types, including pictures, and this worked best for me. However, link.setAttribute('download', null); renamed all my files to...
Read more >Build Cache - Gradle User Manual
The Gradle build cache is a cache mechanism that aims to save time by reusing outputs produced by other builds. The build cache...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes. On Windows, with
cache=False
, when I insert a print statement right beforeos.remove
there, I see both downloaded files deleted (even before the progress bar reports that download is finished).When
cache=True
, it is still called but nothing is done because_tempfilestodel
is an empty list.Maybe this is beyond our control and we should just document this behavior in the API?
Well it uses multiprocessing to download the files. Probably uses separate processes that clean up the files on Windows and ones that share the temp-files with the main process on *NIX systems.