Skip to content

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

Closed

Description

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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