From: "noraj (Alexandre ZANNI) via ruby-core" Date: 2023-02-06T00:53:33+00:00 Subject: [ruby-core:112226] [Ruby master Bug#19414] uninitialized constant URI::WSS in 3.0.X and 3.1.X Issue #19414 has been updated by noraj (Alexandre ZANNI). jeremyevans0 (Jeremy Evans) wrote in #note-1: > Since this is fixed in the master branch and Ruby 3.2, this is a backport request for 3.1 and 3.0. > > For 3.1, it needs commit:c94f964e3f94e9f934a3f4e73fb55f5fd2a21f08 > > For 3.0, it needs commit:c94f964e3f94e9f934a3f4e73fb55f5fd2a21f08 and commit:b875a85c5367b9dff96e1ca1e78a2e35580a2f80 Do I have something to do? Thanks to the Backport field this issue is listed in [Backport 3.1](https://bugs.ruby-lang.org/projects/ruby-master/issues?query_id=287) and [Backport 3.0](https://bugs.ruby-lang.org/projects/ruby-master/issues?query_id=249) but has status closed. However, I don't see the backport committed on [ruby_3_0](https://git.ruby-lang.org/ruby.git/log/?h=ruby_3_0) or [ruby_3_1](https://git.ruby-lang.org/ruby.git/log/?h=ruby_3_1). ---------------------------------------- Bug #19414: uninitialized constant URI::WSS in 3.0.X and 3.1.X https://bugs.ruby-lang.org/issues/19414#change-101649 * Author: noraj (Alexandre ZANNI) * Status: Closed * Priority: Normal * ruby -v: 3.1.3 * Backport: 2.7: UNKNOWN, 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONTNEED ---------------------------------------- I have a library called [ctf-party](https://github.com/noraj/ctf-party), [making use of URI:WSS](https://github.com/noraj/ctf-party/blob/ef3b82cc1668325b782246a9bb162b18a9b2930c/lib/ctf_party/defang.rb#L86), and it's making my [CI pipeline fails](https://github.com/noraj/ctf-party/actions/runs/4059895670). I'm able to reproduce it locally (`bundle exec rake test`), working with ruby 3.2.0 and not with 3.1.3. The error is: ``` irb(main):001:0> require 'uri' => true irb(main):002:0> URI::WS => URI::WS irb(main):003:0> URI::WSS (irb):3:in `
': uninitialized constant URI::WSS (NameError) from /home/noraj/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/irb-1.4.1/exe/irb:11:in `' from /home/noraj/.asdf/installs/ruby/3.1.3/bin/irb:25:in `load' from /home/noraj/.asdf/installs/ruby/3.1.3/bin/irb:25:in `
' ``` I don't understand why is that happening since [it exists in the official documentation](https://ruby-doc.org/3.1.3/stdlibs/uri/URI/WSS.html) and the [code looks ok to me on tag 3.1.3](https://github.com/ruby/ruby/blob/v3_1_3/lib/uri/wss.rb) which is [strictly identical to the code on tag 3.2.0](https://github.com/ruby/ruby/blob/v3_2_0/lib/uri/wss.rb). It works if I require the file explicitly: ``` irb(main):004:0> require 'uri/wss' => true irb(main):005:0> URI::WSS => URI::WSS ``` The issue come from the fact that [in 3.2.0 `'uri/wss'` is required](https://github.com/ruby/ruby/blob/v3_2_0/lib/uri.rb#L104) but [not in 3.1.3](https://github.com/ruby/ruby/blob/v3_1_3/lib/uri.rb#L103). In [3.0.5](https://github.com/ruby/ruby/blob/v3_0_5/lib/uri.rb) it is even worse as neither ws and wss are required. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/