Issue #11180 has been reported by Evgeny Li.

----------------------------------------
Bug #11180: Missing lines with Zlib::GzipReader
https://bugs.ruby-lang.org/issues/11180

* Author: Evgeny Li
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: 2.2.2
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Hi,

I have a script which is written in Python. It simply appends lines to archive file:

~~~python
#!/usr/bin/env python

import gzip

gstoragefile = 'test.json.gz'

gf = gzip.open(gstoragefile, 'ab')
print >> gf, "foo"
gf.close

gf = gzip.open(gstoragefile, 'ab')
print >> gf, "bar"
gf.close
~~~

Later I can read this lines:

~~~
gunzip -c test.json.gz
> foo
> bar
~~~

However, reading this archive with Ruby doesn't work. Looks like Ruby can read only lines from first written batch (*foo*):

~~~ruby
require "zlib"

Zlib::GzipReader.new(File.open("test.json.gz")).readlines.size
# => 1
~~~




-- 
https://bugs.ruby-lang.org/