mirror of
https://github.com/ruby/ruby.git
synced 2025-09-24 04:54:01 +02:00
Open gzip file in binary mode
This commit is contained in:
parent
583f364f71
commit
d05a268adc
1 changed files with 2 additions and 2 deletions
|
@ -516,14 +516,14 @@ if defined? Zlib
|
||||||
gz.close
|
gz.close
|
||||||
|
|
||||||
results = []
|
results = []
|
||||||
t = File.open(t.path)
|
t = File.open(t.path, 'rb')
|
||||||
Zlib::GzipReader.zcat(t) do |str|
|
Zlib::GzipReader.zcat(t) do |str|
|
||||||
results << str
|
results << str
|
||||||
end
|
end
|
||||||
assert_equal(["foo", "bar"], results)
|
assert_equal(["foo", "bar"], results)
|
||||||
t.close
|
t.close
|
||||||
|
|
||||||
t = File.open(t.path)
|
t = File.open(t.path, 'rb')
|
||||||
assert_equal("foobar", Zlib::GzipReader.zcat(t))
|
assert_equal("foobar", Zlib::GzipReader.zcat(t))
|
||||||
t.close
|
t.close
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue