JuliaIO / GZip.jl

A Julia interface for gzip functions in zlib
https://juliaio.github.io/GZip.jl/dev
MIT License
39 stars 30 forks source link

readline() and chomp/keep #69

Open rasmushenningsson opened 6 years ago

rasmushenningsson commented 6 years ago

readline(s::GZipStream) does not handle the chomp keyword that is available in Base, readline(s::IO; chomp::Bool=true), and this causes some confusion.

Calling readline(s::GZipStream) thus gives lines with trailing newline, but readline(s::IO) does not. This is not reflected in the documentation when you type ?readline (or elsewhere).

(If you call readline(s::GZipStream, chomp=true/false) then the method in Base is invoked and the functionality is restored, but Base.readline() is significantly slower and not obvious from a user perspective.)

NB: chomp is replaced by keep in julia 0.7, but the issue remains.

tomhaber commented 3 years ago

default behaviour of readline is different from that on other streams because of this issue. Even though explicitly stating the "keep" keyword kind of fixes the problem, it's not ideal