[#79440] [Ruby trunk Bug#13188] Reinitialize Ruby VM. — shyouhei@...
Issue #13188 has been updated by Shyouhei Urabe.
6 messages
2017/02/06
[#79441] Re: [Ruby trunk Bug#13188] Reinitialize Ruby VM.
— SASADA Koichi <ko1@...>
2017/02/06
On 2017/02/06 10:10, shyouhei@ruby-lang.org wrote:
[#79532] Immutable Strings vs Symbols — Daniel Ferreira <subtileos@...>
Hi,
15 messages
2017/02/15
[#79541] Re: Immutable Strings vs Symbols
— Rodrigo Rosenfeld Rosas <rr.rosas@...>
2017/02/15
Em 15-02-2017 05:05, Daniel Ferreira escreveu:
[#79543] Re: Immutable Strings vs Symbols
— Daniel Ferreira <subtileos@...>
2017/02/16
Hi Rodrigo,
[#79560] Re: Immutable Strings vs Symbols
— Rodrigo Rosenfeld Rosas <rr.rosas@...>
2017/02/16
Em 15-02-2017 22:39, Daniel Ferreira escreveu:
[ruby-core:79385] [Ruby trunk Bug#13178] CGI.unescape change in behavior
From:
nobu@...
Date:
2017-02-02 01:34:18 UTC
List:
ruby-core #79385
Issue #13178 has been updated by Nobuyoshi Nakada.
Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED
It's an older bug than it.
```
$ ruby2.1 -rcgi -e 'CGI.accept_charset = "ISO-8859-15"; p CGI.unescape("foo").encoding'
#<Encoding:UTF-8>
```
There are different `@@accept_charset` variables.
----------------------------------------
Bug #13178: CGI.unescape change in behavior
https://bugs.ruby-lang.org/issues/13178#change-62813
* Author: Vit Ondruch
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
* Backport: 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED
----------------------------------------
CGI.unescape does not work anymore when just "cgi/util" is required.
~~~
$ ruby -v -rcgi/util -e 'CGI.unescape("foo=bar&foo=baz&page=1")'
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
$ ruby -v -rcgi/util -e 'CGI.unescape("foo=bar&foo=baz&page=1")'
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
-e:1:in `unescape': uninitialized class variable @@accept_charset in #<Class:CGI> (NameError)
from -e:1:in `<main>'
~~~
It works just fine if whole "cgi" is required. Not sure if this is intentional or just side effect (probably due to r55540 or r54655 ?), but it breaks existing projects, e.g. httparty test suite fails due to this change:
~~~
1) HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER doesn't modify strings
Failure/Error: expect(CGI.unescape(query_string)).to eq("foo=bar&foo=baz")
NameError:
uninitialized class variable @@accept_charset in #<Class:CGI>
# ./spec/httparty/request_spec.rb:13:in `unescape'
# ./spec/httparty/request_spec.rb:13:in `block (3 levels) in <top (required)>'
~~~
Also please note that httparty does not require "cqi" at all. It is required via some transitive dependencies. Presumably via ERB [1]. So in case that this is intentional behavior, ERB should require s|cgi/utils|cgi| IMO.
[1]: https://github.com/ruby/ruby/blob/trunk/lib/erb.rb#L15
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>