Skip to content

Commit

Permalink
Merge pull request JuliaLang#38190 from JuliaLang/sk/bump-Downloads
Browse files Browse the repository at this point in the history
bump Downloads stdlib (new APIs: progress, request)
  • Loading branch information
StefanKarpinski committed Oct 27, 2020
2 parents bd304ef + 1b42549 commit 33b6eda
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 10 deletions.
9 changes: 4 additions & 5 deletions base/download.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ specified, a temporary path. Returns the path of the downloaded file.
around `Downloads.download`. In new code, you should use that function
directly instead of calling this.
"""
function download(url::AbstractString, path::AbstractString)
download(url::AbstractString, path::AbstractString) = do_download(url, path)
download(url::AbstractString) = do_download(url, nothing)

function do_download(url::AbstractString, path::Union{AbstractString, Nothing})
depwarn("Base.download is deprecated; use Downloads.download instead", :download)
invokelatest(Downloads().download, download_url(url), path)
end
function download(url::AbstractString)
depwarn("Base.download is deprecated; use Downloads.download instead", :download)
invokelatest(Downloads().download, download_url(url))
end

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b0d70c76a47175b9a8555ec8dd86cdd9
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3f1683749520af246f536e03d2b3865c91de85bc801d4767a6452553293a4862a5f4e6bf45c7c9dc9c8f0ccdf26c2412a5c94554b91104e10b7bcbfdd77c1d5a
2 changes: 1 addition & 1 deletion stdlib/Downloads.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DOWNLOADS_BRANCH = master
DOWNLOADS_SHA1 = 1aa487fc72a5db5aebe811a2f54cb6597f8208e6
DOWNLOADS_SHA1 = 68bf4b6b28bb382237016433e9165a2833d1d49c
4 changes: 2 additions & 2 deletions test/download_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ mktempdir() do temp_dir

# Make sure that failed downloads do not leave files around
missing_file = joinpath(temp_dir, "missing")
@test_throws ErrorException download("https://httpbin.julialang.org/status/404", missing_file)
@test_throws Exception download("https://httpbin.julialang.org/status/404", missing_file)
@test !isfile(missing_file)

# Use a TEST-NET (192.0.2.0/24) address which shouldn't be bound
invalid_host_file = joinpath(temp_dir, "invalid_host")
@test_throws ErrorException download("http:https://192.0.2.1", invalid_host_file)
@test_throws Exception download("http:https://192.0.2.1", invalid_host_file)
@test !isfile(invalid_host_file)
end

Expand Down

0 comments on commit 33b6eda

Please sign in to comment.