forked from apache/mxnet
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Gluon download function to be atomic (apache#12572)
* use rename trick to achieve atomic write but didn't support python2 and windows * add test for multiprocess download * implement atomic_replace referred by https://github.com/untitaker/python-atomicwrites * change the number of testing process to 10 * add docstring and disable linter * half way to address some issue reviewer have * use warning instead of raise UserWarn * check for sha1 * Trigger CI * fix the logic of checking hash * refine the error message * add more comments and expose the error message to the user * delete trailing whitespace * rename _path_to_encode to _str_to_unicode * fix the error message bug and add remove when the movefile fail on windows * add remove temp file for non-windows os * handle the OSError caused by os.remove * Trigger CI * use finally to raise failure of atomic replace * add missing try except block for os.remove * add retries value to error message
- Loading branch information
1 parent
4315168
commit 8b5e70d
Showing
2 changed files
with
127 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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