Julia: Base.download() no longer unzips .gz

Created on 17 Feb 2018  路  6Comments  路  Source: JuliaLang/julia

On Windows 'Base.download()' would unzip '.gz' files automatically when saving (which I don't believe was a documented feature), in 0.7.0-DEV this doesn't happen anymore.

Seems to be caused by #25477 as the old ccall to 'URLDownloadToFileW' appears to be what used to do the unzipping .gz for the download.

Since unzipping was never documented I doubt it was originally an intended feature, if so then I'll close the issue.

windows

All 6 comments

That does seem like it was a rather surprising an unintentional feature. I would very much not expect the download function to do anything but, you know, download something.

I'm surprised you say the old version unzipped files, as the docs for URLDownloadToFileW don't mention this at all, and that's not what I observe on Windows 10 (for example with https://github.com/JuliaLang/julia/releases/download/v0.6.2/julia-0.6.2.tar.gz). Can you show a reproducer?

Yeah, thought as much, I'll close the issue. Should help if anybody else runs into the same thing.

@nalimilan Sorry didn't see your comment, here you go: https://gist.github.com/RankWinner/cc99137c1f7f9df428dcb6e69646f259

In 0.6.2 the file is downloaded and (seemingly?) unzipped, can be opened by a text editor/read by readdlm.

In 0.7.0 the file is downloaded as (I assume) a .gz, it's only 718 KB vs. the 4,684 KB file you get in 0.6.2, opening it in a text editor shows 1f8b 0800 174f 855a 0203 ec5d f953 e348 which I guess is the compressed .gz data. In the notebook I use 7zip included in Julia to uncompress it before reading it with readdlm.

Funny, I can reproduce with your example. It probably have to do with the way the HTTP server describes the file: indeed it uses Content-Encoding: x-gzip and Content-Type: text/plain.

Anyway, the 0.7 behavior is much saner.

the docs for URLDownloadToFileW don't mention this at all

I think this behavior is: https://msdn.microsoft.com/en-us/library/windows/desktop/aa383955(v=vs.85).aspx

(all these years I've been installing 7-zip to deal with .gz files on Windows...)

Was this page helpful?
0 / 5 - 0 ratings