Skip to content

Zlib::GzipWriter#<< wrongly returns nil #1623

myronmarston opened this Issue Mar 19, 2012 · 1 comment

3 participants

# use_zlib.rb

require 'stringio'
require 'zlib'

io =
content = "abc"<<(content).close

puts io.string

MRI 1.8.7:

➜ rvm use 1.8.7
Using /Users/myron/.rvm/gems/ruby-1.8.7-p352
➜ ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin10.8.0]
➜ ruby use_zlib.rb 

MRI 1.9.2:

➜ rvm use 1.9.2
Using /Users/myron/.rvm/gems/ruby-1.9.2-p290
➜ ruby --version
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
➜ ruby use_zlib.rb 


➜ rvm use rbx
Using /Users/myron/.rvm/gems/rbx-head
➜ ruby --version
rubinius 2.0.0dev (1.8.7 66086cff yyyy-mm-dd JI) [x86_64-apple-darwin10.8.0]
➜ ruby use_zlib.rb 
An exception occurred running use_zlib.rb
    undefined method `close' on nil:NilClass. (NoMethodError)

  Kernel(NilClass)#close (method_missing) at kernel/delta/kernel.rb:81
                     Object#__script__ at use_zlib.rb:6
      Rubinius::CodeLoader#load_script at kernel/delta/codeloader.rb:67
      Rubinius::CodeLoader.load_script at kernel/delta/codeloader.rb:109
               Rubinius::Loader#script at kernel/loader.rb:630
                 Rubinius::Loader#main at kernel/loader.rb:834
Rubinius member
jc00ke commented Mar 19, 2012

@myronmarston thanks, looks like it's broken in both 1.8 & 1.9 mode (which tracks 1.9.3, not 1.9.2 fyi)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.