Actions
Bug #11180
closedMissing lines with Zlib::GzipReader
Description
Hi,
I have a script which is written in Python. It simply appends lines to archive file:
#!/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):
require "zlib"
Zlib::GzipReader.new(File.open("test.json.gz")).readlines.size
# => 1
Actions
Like0
Like0Like0Like0