Actions
Bug #10150
closedTiny URI.parse error incompatibility
Description
When giving URI.parse an object that does't respond_to #to_str, Ruby 2.1 raises URI::InvalidURIError, whereas 2.2 raises NoMethodError.
Is this change intentional?
% ruby -v -ruri -e "p URI.parse(1)"
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
.../2.1.2/lib/ruby/2.1.0/uri/common.rb:176:in `split': bad URI(is not URI?): 1 (URI::InvalidURIError)
% ruby -v -ruri -e "p URI.parse(1)"
ruby 2.2.0dev (2014-08-19 trunk 47220) [x86_64-darwin13]
.../2.2.0-dev/lib/ruby/2.2.0/uri/rfc3986_parser.rb:9:in split': undefined method
to_str' for 1:Fixnum (NoMethodError)
Actions
Like0
Like0