[#11073] segfault printing instruction sequence for iterator — <noreply@...>

Bugs item #10527, was opened at 2007-05-02 14:42

14 messages 2007/05/02
[#11142] Re: [ ruby-Bugs-10527 ] segfault printing instruction sequence for iterator — Nobuyoshi Nakada <nobu@...> 2007/05/10

Hi,

[#11188] Re: [ ruby-Bugs-10527 ] segfault printing instruction sequence for iterator — Paul Brannan <pbrannan@...> 2007/05/16

On Thu, May 10, 2007 at 04:51:18PM +0900, Nobuyoshi Nakada wrote:

[#11234] Planning to release 1.8.6 errata — Urabe Shyouhei <shyouhei@...>

Hi all.

17 messages 2007/05/25

[ ruby-Bugs-10894 ] URI Methods Raise Unclear Exceptions When Passed URI Objects

From: <noreply@...>
Date: 2007-05-18 14:14:46 UTC
List: ruby-core #11204
Bugs item #10894, was opened at 2007-05-18 14:14
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=10894&group_id=426

Category: Standard Library
Group: 1.8.5
Status: Open
Resolution: None
Priority: 3
Submitted By: Ben Coffey (benc)
Assigned to: Nobody (None)
Summary: URI Methods Raise Unclear Exceptions When Passed URI Objects

Initial Comment:
If a URI object is passed another URI object when it's expecting a string, it throws an exception. Regardless of whether this is a good idea, the exception is very unclear.

For example:

    require 'uri'
    url = 'http://ruby-lang.org/'
    URI.parse(URI.parse url)

Trackback:

    /usr/lib/ruby/1.8/uri/common.rb:432:in `split': bad URI(is not URI?):
   http://ruby-lang.org/ (URI::InvalidURIError)
        from /usr/lib/ruby/1.8/uri/common.rb:481:in `parse'
        from /usr/lib/ruby/1.8/uri/common.rb:516:in `join'
        from /tmp/uri.rb:5

It's helpful if URI's methods accept URI objects as arguments because you will typically construct a new URL from an old one, and the old one is likely to also be a URI object. Presumably this is just a case of the methods calling 'to_s' on their arguments.

If the current behaviour is to be retained, then could the error message be clarified? Displaying a valid URL and simultaneously claiming that it's bad, is, um, bad. :-)


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=10894&group_id=426

In This Thread

Prev Next