On Oct 23, 2008, at 23:57 , Nobuyoshi Nakada wrote: > At Fri, 24 Oct 2008 15:34:18 +0900, > Tanaka Akira wrote in [ruby-core:19469]: >>> No chance to use reopen inside the block? >> What's the advantage? > > It could restore the originals even if STDOUT.reopen were used > in the block given to capture_io. Can't reopen be used there? It couldn't back in the day... that was what I was using. Matz gave me the replacement code at Rubyconf in Austin TX. I've applied Akira's code... it passes its tests.