-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File path encoding problem on Windows #394
Comments
Given that I see this: https:/r-lib/vroom/blob/c5b115b1b5f21852886d6407317386b215706239/R/path.R#L22-L23 I suspect this change needs to be brought over from readr: We should also add a test. Adapt basic approach from this test in readxl: |
One important feature of OP's original file (the one from the readr issue) is that it doesn't end in a newline. For some reason, the very important message "Files must end with a newline" isn't captured by reprex (we should follow up on this!):
I also don't understand why re-encoding the path helps with that, but it does: vroom::vroom(enc2utf8("C:/Users/jenny/Downloads/Renda Fixa Pré.csv"), n_max = 3)
#> Rows: 3 Columns: 5
#> -- Column specification --------------------------------------------------------
#> Delimiter: ","
#> chr (2): Nome, Tipo
#> dbl (2): Prazo, InvestimentoInicial
#>
#> i Use `spec()` to retrieve the full column specification for this data.
#> i Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> # A tibble: 3 x 5
#> Nome Taxa Tipo Prazo InvestimentoInicial
#> <chr> <dbl> <chr> <dbl> <dbl>
#> 1 CDB Caruana Pre 22 PRÉ 365 1000
#> 2 CDB Fator Pré-fixado 22 PRÉ 365 5000
#> 3 CDB NBC Pré-fixado 22 PRÉ 365 1000 Created on 2022-02-08 by the reprex package (v2.0.1) We probably still need to work on path handling and testing here, but the whole situation is more confusing than originally thought. |
In the maintenance document, there are some relevant points (bold is mine): https:/r-lib/vroom/blame/e1020f6b843dc1c882a37a6d6bb66e8f70c6a02f/MAINTENANCE.md#L12-L24
This is starting to shed a little light on how the lack of trailing new line changes things. Still hard to see how path encoding is interacting with this, but it sure seems to be. |
Manual transfer of tidyverse/readr#1345
Created on 2022-01-03 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: