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

readr fails to interpret gzip multibyte string #1125

Closed
cboettig opened this issue Sep 16, 2020 · 0 comments
Closed

readr fails to interpret gzip multibyte string #1125

cboettig opened this issue Sep 16, 2020 · 0 comments

Comments

@cboettig
Copy link
Contributor

cboettig commented Sep 16, 2020

Given a g'zipped file that does not have a file extension, readr complains that it has detected an invalid multibyte string. Note that in contrast, vroom correctly detects the gzip type:

readr::write_tsv(mtcars, "mtcars.tsv.gz")
fs::file_copy("mtcars.tsv.gz", "mtcars")
# works
vroom::vroom("mtcars")

# error invalid multi-byte string
readr::read_tsv("mtcars")

# works once we manually use gzfile, ick
readr::read_tsv(gzfile("mtcars"))

## works with extension from file name
readr:::read_tsv("mtcars.tsv.gz")

My understanding is that it would be best for readr to identify the compression from the multibyte string instead of relying on the convention of a filename extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant