From: exaspark@... Date: 2015-05-26T09:33:08+00:00 Subject: [ruby-core:69361] [Ruby trunk - Bug #11180] Missing lines with Zlib::GzipReader Issue #11180 has been updated by Evgeny Li. Looks like the issue might be similar to https://bugs.ruby-lang.org/issues/9790. ---------------------------------------- Bug #11180: Missing lines with Zlib::GzipReader https://bugs.ruby-lang.org/issues/11180#change-52635 * 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/