IO#open, IO#popen, File#open  with block should not raise error when io is 
closed inside the block
--------------------------------------------------------------------------------------------------

                 Key: JRUBY-2024
                 URL: http://jira.codehaus.org/browse/JRUBY-2024
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1RC1
         Environment: Latest JRuby 1.1RC1 from trunk
            Reporter: Vladimir Sizikov
            Assignee: Vladimir Sizikov


The following example:

{noformat}
f = File.open("test-file", "w+") { |fh|
  fh.close
}

io = IO.popen("ls", "r+") { |io|
  io.close
}

io = IO.new(2, "w") { |io|
  io.close
}
{noformat}

passes just fine on MRI, but raises an error on JRuby, for
all three cases:
Bad file descriptor (Errno::EBADF)

This also leads to one rubyspec failure:
File.open opens a file with a file descriptor d and a block ERROR
Bad file descriptor:
/opt/work/rubinius/./spec/ruby/1.8/core/file/open_spec.rb:88
/opt/work/rubinius/./spec/ruby/1.8/core/file/open_spec.rb:88:in `call'
./mspec/runner/runner.rb:136:in `describe'
./mspec/runner/runner.rb:135:in `describe'
/opt/work/rubinius/./spec/ruby/1.8/core/file/open_spec.rb:3
/opt/work/rubinius/./spec/ruby/1.8/core/file/open_spec.rb:3:in `load'
tmp/last_ci.rb:52
tmp/last_ci.rb:44


Fix is coming.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to