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.
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
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, butreadline(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, butBase.readline()
is significantly slower and not obvious from a user perspective.)NB:
chomp
is replaced bykeep
in julia 0.7, but the issue remains.