Skip to content

fread tries to use wget on file:// input in RStudio #1668

Description

@MichaelChirico

Not sure what's going on here, but two tests fail when I run them in R Studio, but not from command line:

library(data.table)
test.data.table()

Running test id 1378.2 Test 1378.2 Error in download.file(input, tt, mode = "wb", quiet = !showProgress) :
(converted from warning) download had nonzero exit status
Running test id 1378.3 Test 1378.3 didn't produce correct error :
fread(f, showProgress = FALSE)
Expected error: 'Line ending is ._r._r._n. R's download.file() appears to add the extra ._r in text mode on Windows. Please download again in binary mode (mode='wb') which might be faster too. Alternatively, pass the URL directly to fread and it will download the file in binary mode for you.'
Observed warning: 'download had nonzero exit status'

However, when I run from terminal:

R -e 'library(data.table); test.data.table()'

All is well:

All 5385 tests (lastID=1668.5) in inst/tests/tests.Rraw completed ok in 00:01:20 on Fri Apr 22 16:48:58 2016 (endian=little, sizeof(long double)==16)

Running 3.2.4 on RStudio 0.99.878, Linux Mint 17.3 = Ubuntu 14.04.3 LTS

I've been experiencing this for a while, but ignoring it because all the PRs pass Travis, etc. I only discovered the bit about the command line today, I was a bit surprised.

Activity

  1. jangorecki commented on Apr 22, 2016

    @jangorecki
    Member

    My guess is that RStudio may silently change download.method option and affect output, comparing to base R.
    Anyway if it works in R, and just not works in RStudio then you should report it to RStudio. Base R should be the platform to which other projects should be conformed.

    As you are on linux you may find my 3 helpful scripts:

    # dt.build
    R CMD build data.table --no-manual
    # dt.install
    R CMD INSTALL data.table_1.9.7.tar.gz
    # dt.check
    R CMD check data.table_1.9.7.tar.gz --no-manual --as-cran
    

    Use chmod to make them executable, and call in shell from parent dir of data.table:

    ./dt.build && ./dt.install # install devel
    ./dt.build && ./dt.check # check devel
    

    Once I started to use them I had no need to debug issues related to intermediate helpers. It also plays nicely when switching to other branches.

  2. MichaelChirico commented on Apr 23, 2016

    @MichaelChirico
    MemberAuthor

    Indeed, because I have the "Use secure download method for HTTP" option set in Tools>Global Options...>Packages, getOption("download.file.method", default = "auto") is set to wget, which doesn't support file:///.

    Seems like a fix would be to force curl in the case that is_file is true.

    Gonna put a PR to that end.

  3. changed the title [-][Internals] Tests 1378.2, 1378.3 fail in RStudio[/-] [+]fread tries to use wget on file:// input in RStudio[/+] on Apr 23, 2016
  4. added a commit that references this issue on Apr 24, 2016
    6873afa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions