On Sun, Nov 6, 2011 at 3:36 PM, Rob Hunter (JIRA) <j...@codehaus.org> wrote:

> open-uri raises an encoding error in 1.9 mode
> ---------------------------------------------
>
>                 Key: JRUBY-6189
>                 URL: https://jira.codehaus.org/browse/JRUBY-6189
>             Project: JRuby
>          Issue Type: Bug
>          Components: Standard Library
>    Affects Versions: JRuby 1.7
>         Environment: jruby master (as at Nov 6; git hash
> f1a5b6b5e6c9f9cb2e53f8703cf1626df0e4ca25)
> rvm, Mac OS X 10.7 "Lion"
>            Reporter: Rob Hunter
>            Assignee: Thomas E Enebo
>
>
> The 'open-uri' portion of the standard library cannot be included from
> within JRuby's Ruby 1.9 mode.
>
> {noformat}
> $ rvm jruby-1.6.5 exec    ruby --1.9 -e 'require "open-uri"' # runs
> without error
> $ rvm jruby-head  exec    ruby --1.8 -e 'require "open-uri"' # runs
> without error
> {noformat}
> {noformat}
> $ rvm jruby-head  exec    ruby --1.9 -e 'require "open-uri"'
> RegexpError: /.../n has a non escaped non ASCII character in non
> ASCII-8BIT script
>     Meta at ..../jruby-head/lib/ruby/1.9/open-uri.rb:458
>  OpenURI at ..../jruby-head/lib/ruby/1.9/open-uri.rb:394
>   (root) at ..../jruby-head/lib/ruby/1.9/open-uri.rb:94
>  require at org/jruby/RubyKernel.java:970
>  require at ..../jruby-head/lib/ruby/1.9/open-uri.rb:36
>   (root) at -e:1
> {noformat}
>
> The problematic line appears to be the numeric portion of the following
> regex:
> {code:label="open-uri.rb"}
>     RE_QUOTED_STRING = %r{"(?:[\r\n\t
> !#-\[\]-~\x80-\xff]|\\[\x00-\x7f])*"}n
> {code}
>
>

I believe this duplicates 6143.  The proposed fixed I mentioned in my
comments will allow open-uri to load.

Matt

Reply via email to