diff options
| author | bors <bors@rust-lang.org> | 2023-02-09 04:03:20 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-02-09 04:03:20 +0000 |
| commit | e7acd078f443156b95cee11759a735db1cfc796e (patch) | |
| tree | dd40e9d754e085d07687fcfaf62a031dac9177c1 /src/bootstrap/bootstrap.py | |
| parent | 575d424c94e0d4feea8cf4fcf04d47b83f28eaef (diff) | |
| parent | 3e07554fd73079a38a7d659676c2ada99db47d93 (diff) | |
Auto merge of #107828 - compiler-errors:rollup-gyj6dgj, r=compiler-errors
Rollup of 9 pull requests Successful merges: - #107317 (Implement `AsFd` and `AsRawFd` for `Rc`) - #107429 (Stabilize feature `cstr_from_bytes_until_nul`) - #107713 (Extend `BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`.) - #107761 (Replace a command line flag with an env var to allow tools to initialize the tracing loggers at their own discretion) - #107790 ( x.py fails all downloads that use a tempdir with snap curl #107722) - #107799 (correctly update goals in the cache) - #107813 (Do not eagerly recover for bad `impl Trait` types in macros) - #107817 (rustdoc: use svgo to shrink `wheel.svg`) - #107819 (Set `rust-analyzer.check.invocationLocation` to `root`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/bootstrap/bootstrap.py')
| -rw-r--r-- | src/bootstrap/bootstrap.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 5b19a658fb5..c298817895c 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -87,14 +87,16 @@ def _download(path, url, probably_big, verbose, exception): # If curl is not present on Win32, we should not sys.exit # but raise `CalledProcessError` or `OSError` instead require(["curl", "--version"], exception=platform_is_win32) - run(["curl", option, - "-L", # Follow redirect. - "-y", "30", "-Y", "10", # timeout if speed is < 10 bytes/sec for > 30 seconds - "--connect-timeout", "30", # timeout if cannot connect within 30 seconds - "--retry", "3", "-Sf", "-o", path, url], - verbose=verbose, - exception=True, # Will raise RuntimeError on failure - ) + with open(path, "wb") as outfile: + run(["curl", option, + "-L", # Follow redirect. + "-y", "30", "-Y", "10", # timeout if speed is < 10 bytes/sec for > 30 seconds + "--connect-timeout", "30", # timeout if cannot connect within 30 seconds + "--retry", "3", "-Sf", url], + stdout=outfile, #Implements cli redirect operator '>' + verbose=verbose, + exception=True, # Will raise RuntimeError on failure + ) except (subprocess.CalledProcessError, OSError, RuntimeError): # see http://serverfault.com/questions/301128/how-to-download if platform_is_win32: |
