Skip to content
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

v1.3.1 - fails to parse empty gzipped files #963

Closed
jemunro opened this issue Jan 29, 2019 · 2 comments
Closed

v1.3.1 - fails to parse empty gzipped files #963

jemunro opened this issue Jan 29, 2019 · 2 comments

Comments

@jemunro
Copy link

jemunro commented Jan 29, 2019

I have noted the following difference in behaviour of readr v1.1.1 and readr v1.3.0 when handling empty gzipped files.

readr v1.1.1

printf '' > empty.txt
R --slave --vanilla -e "readr::read_tsv('empty.txt')"
# A tibble: 0 x 0
gzip empty.txt
R --slave --vanilla -e "readr::read_tsv('empty.txt.gz')"
# A tibble: 0 x 0

readr v1.3.1

printf '' > empty.txt
R --slave --vanilla -e "readr::read_tsv('empty.txt')"
# A tibble: 0 x 0
gzip empty.txt
R --slave --vanilla -e "readr::read_tsv('empty.txt.gz')"
Error in guess_header_(datasource, tokenizer, locale) :
  Cannot read file /tmp/RtmpnGGnIo/file4c96730e72d7: Invalid argument
Calls: <Anonymous> ... col_spec_standardise -> guess_header -> guess_header_
Execution halted
@pralitp
Copy link
Contributor

pralitp commented Feb 5, 2019

I am running into a similar issue. I wonder if the underlying issue comes from trying to read from an empty connection. Here is a simplified example:

> test <- readr::read_csv("empty.csv")
> test
# A tibble: 0 x 0
> conn <- file("empty.csv")
> test <- readr::read_csv(conn)
Error in guess_header_(datasource, tokenizer, locale) : 
  Cannot read file /private/var/folders/db/txjmp0ms653f_z_6yj2hk8880000gn/T/Rtmpuiadeb/fileb1c027e27ffe: Invalid argument

@lock
Copy link

lock bot commented Aug 10, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Aug 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants