From: colin@... Date: 2015-12-07T15:59:29+00:00 Subject: [ruby-core:71910] [Ruby trunk - Bug #11759] URI breaks with frozen strings Issue #11759 has been updated by Colin Kelley. File 11759-rev3.patch added > I prefer String.new() to "".dup because the former describes intention (of creating a buffer). Ok. I've attached a rev3 patch that uses `String.new` instead of `''.dup`. > In fact, my best choice is introducing String#+ that returns a mutable copy of a string. How would that be different from the current binary string operator `String#+` that does string concatenation? ---------------------------------------- Bug #11759: URI breaks with frozen strings https://bugs.ruby-lang.org/issues/11759#change-55316 * Author: Mike Perham * Status: Open * Priority: Normal * Assignee: * ruby -v: 2.3.0-preview1 * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- It appears URI uses String mutation and breaks frozen string mode. ~~~ $ RUBYOPT="--enable-frozen-string-literal" bundle exec rake /Users/mike/.rubies/ruby-2.3.0-preview1/lib/ruby/2.3.0/uri/generic.rb:1344:in `to_s': can't modify frozen String (RuntimeError) /Users/mike/.gem/ruby/2.3.0/gems/bundler-1.10.6/lib/bundler/source/rubygems.rb:257:in `normalize_uri' /Users/mike/.gem/ruby/2.3.0/gems/bundler-1.10.6/lib/bundler/source/rubygems.rb:198:in `add_remote' /Users/mike/.gem/ruby/2.3.0/gems/bundler-1.10.6/lib/bundler/source/rubygems.rb:25:in `block in initialize' /Users/mike/.gem/ruby/2.3.0/gems/bundler-1.10.6/lib/bundler/source/rubygems.rb:25:in `reverse_each' /Users/mike/.gem/ruby/2.3.0/gems/bundler-1.10.6/lib/bundler/source/rubygems.rb:25:in `initialize' ~~~ ---Files-------------------------------- 0001-Do-not-mutate-strings-in-URI-to_s.patch (1.76 KB) 11759.patch (610 Bytes) 11759-rev2.patch (3.21 KB) 11759-rev3.patch (3.21 KB) -- https://bugs.ruby-lang.org/