File.new doesn't accept Pathname as its argument ------------------------------------------------
Key: JRUBY-1926 URL: http://jira.codehaus.org/browse/JRUBY-1926 Project: JRuby Issue Type: Bug Components: Core Classes/Modules Affects Versions: JRuby 1.1RC1 Environment: 1.1RC1 Reporter: Changshin Lee With MRI, >> require 'pathname' => true >> p = Pathname.new('/Users/ias/Downloads/engkor.dmg') => #<Pathname:/Users/ias/Downloads/engkor.dmg> >> f = File.new(p) => #<File:/Users/ias/Downloads/engkor.dmg> >> With JR1.1RC1 >> require 'pathname' => true >> p = Pathname.new('/Users/ias/Downloads/engkor.dmg') => #<Pathname:/Users/ias/Downloads/engkor.dmg> >> f = File.new(p) wrong argument type Pathname (expected String) It seems that Pathname should be RubyString or RubyFile.intialize skips in case of Pathname like my quick patch: if (!args[0].getMetaClass().getName().equals("Pathname")) { getRuntime().checkSafeString(args[0]); } -- 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