@@ -104,16 +104,15 @@ def _download(path, url, probably_big, verbose, exception):
104
104
# If curl is not present on Win32, we should not sys.exit
105
105
# but raise `CalledProcessError` or `OSError` instead
106
106
require (["curl" , "--version" ], exception = platform_is_win32 ())
107
- with open (path , "wb" ) as outfile :
108
- run (["curl" , option ,
109
- "-L" , # Follow redirect.
110
- "-y" , "30" , "-Y" , "10" , # timeout if speed is < 10 bytes/sec for > 30 seconds
111
- "--connect-timeout" , "30" , # timeout if cannot connect within 30 seconds
112
- "--retry" , "3" , "-SRf" , url ],
113
- stdout = outfile , #Implements cli redirect operator '>'
114
- verbose = verbose ,
115
- exception = True , # Will raise RuntimeError on failure
116
- )
107
+ run (["curl" , option ,
108
+ "-L" , # Follow redirect.
109
+ "-y" , "30" , "-Y" , "10" , # timeout if speed is < 10 bytes/sec for > 30 seconds
110
+ "--connect-timeout" , "30" , # timeout if cannot connect within 30 seconds
111
+ "-o" , path ,
112
+ "--retry" , "3" , "-SRf" , url ],
113
+ verbose = verbose ,
114
+ exception = True , # Will raise RuntimeError on failure
115
+ )
117
116
except (subprocess .CalledProcessError , OSError , RuntimeError ):
118
117
# see http://serverfault.com/questions/301128/how-to-download
119
118
if platform_is_win32 ():
0 commit comments