[MacRuby-devel] [MacRuby] #576: It's possible to close STDOUT (and presumably other standard IO streams)

MacRuby ruby-noreply at macosforge.org
Mon Jan 25 18:42:04 PST 2010


#576: It's possible to close STDOUT (and presumably other standard IO streams)
-----------------------------------+----------------------------------------
 Reporter:  matthew@…              |       Owner:  lsansonetti@…        
     Type:  defect                 |      Status:  new                  
 Priority:  critical               |   Milestone:  MacRuby 0.5          
Component:  MacRuby                |    Keywords:                       
-----------------------------------+----------------------------------------
 Run the following in irb, then macirb:

 {{{
 STDOUT.close
 }}}

 '''Expected (Ruby 1.9.1):'''
 {{{
 => nil
 }}}

 '''Actual (MacRuby 0.5 beta 2):'''
 {{{
 (closes interpreter)
 }}}

 The expected behavior is to ignore close requests to standard IO streams.
 Ruby does this, but MacRuby does not.  When using macirb, calling
 {{{STDOUT.close}}} simply closes the interpreter, whereas in Ruby it
 returns nil.

 This has important real-world implications when dealing with logging.
 Consider logging to STDOUT; Logger#close actually closes the STDOUT
 stream!

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/576>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list