From: iehnrtnc@... Date: 2017-01-02T03:35:47+00:00 Subject: [ruby-core:78937] [Ruby trunk Bug#13094] Zlib::GzipReader eof?がfalseなのにgetsでnilが返ってくる Issue #13094 has been reported by Hironao TSUTSUMIDA. ---------------------------------------- Bug #13094: Zlib::GzipReader eof?���false���������gets���nil������������������ https://bugs.ruby-lang.org/issues/13094 * Author: Hironao TSUTSUMIDA * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.4.0preview2 (2016-09-09 trunk 56129) [x86_64-darwin15] * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- ���������������������eof?���false������������gets���nil��������������������������������������������������������������������������������������������������� zlib���eof?������������������������������ ~~~ ruby require 'zlib' o = ('!'..'~').to_a i = 225 1000.times do Zlib::GzipWriter.open('./s.gz') do |gz| i.times do gz.write(o.sample(10)*""+"\n") end end Zlib::GzipReader.open("./s.gz") { |gz| puts gz.gets.chomp! until gz.eof? } puts "#{i}, #{File.size('./s.gz')}" if File.size('./s.gz') > 2058 i -= 1 else i += 1 end end ~~~ ~~~ ruby -:10:in `block (2 levels) in
': undefined method `chomp!' for nil:NilClass (NoMethodError) from -:10:in `open' from -:10:in `block in
' from -:4:in `times' from -:4:in `
' ~~~ ---Files-------------------------------- s.gz (2.01 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: