[1.9] IO#copy_stream unable to take a File object -------------------------------------------------
Key: JRUBY-4420 URL: http://jira.codehaus.org/browse/JRUBY-4420 Project: JRuby Issue Type: Bug Components: Ruby 1.9 Affects Versions: JRuby 1.5 Environment: JVM 1.5 on Leopard PPC, JVM 1.6 on WinXP Reporter: Ian Dees Assignee: Thomas E Enebo Priority: Minor Fix For: JRuby 1.5 The docs for {{IO#copy_stream}} state that the source and destination can either be filenames or {{IO}} instances. And indeed, YARV seems to support both types. But JRuby's version of the method currently does not accept {{IO}} objects (or {{File}} objects, which are instances of {{IO}}). The following test case (which assumes the {{setup}}/{{teardown}}/helpers from {{test_io.rb}}) demonstrates the problem. It passes on YARV but fails with {{jruby --1.9}}. {noformat} def test_copy_stream_with_string_and_io ensure_files @file File.open(@file2, 'w') do |f2| IO.copy_stream @file, f2 end assert_equal IO.read(@file), IO.read(@file2) end {noformat} On JRuby, this throws {{TypeError: Should be String or IO}}. The error persists whether you use a {{File}} or a base {{IO}}. This behavior affects {{FileUtils#install}} and therefore RubyGems. -- 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