Bug #20985
closedUndefined constant in net/http
Description
$ grep -rnH HTTPAuthenticationError /usr/local/lib/ruby
/usr/local/lib/ruby/site_ruby/3.3/rubygems/vendor/net-http/lib/net/http.rb:2455: raise HTTPAuthenticationError.new('HTTP authentication failed', err)
/usr/local/lib/ruby/3.3/net/http.rb:2455: raise HTTPAuthenticationError.new('HTTP authentication failed', err)
/usr/local/lib/ruby/3.3/rubygems/vendor/net-http/lib/net/http.rb:2455: raise HTTPAuthenticationError.new('HTTP authentication failed', err)
$ ruby -r net/http -e 'HTTPAuthenticationError'
-e:1:in `<main>': uninitialized constant HTTPAuthenticationError (NameError)
HTTPAuthenticationError
^^^^^^^^^^^^^^^^^^^^^^^
The raise
statement will just transform a meaningful error into a NameError
.
Updated by nobu (Nobuyoshi Nakada) 6 days ago
- Description updated (diff)
This constant was introduced in ae2c8b45d2c345faea6a7f2203603b4862f3a66c, but has never existed then or since.
Although we cannot guess the author's intention, the rescue
clause looks able to be removed safely.
Could you report it to the upstream, https://github.com/ruby/net-http?
Updated by BertramScharpf (Bertram Scharpf) 5 days ago
nobu (Nobuyoshi Nakada) wrote in #note-1:
Could you report it to the upstream, https://github.com/ruby/net-http?
Sorry, no. For just removing two lines of code, this report should suffice.
The net-http project currently has 16 open pull requests and 30 open issues;
the oldest one waits for almost 4 years to be answered. I have better things
to do than being ignored by those people.
Besides that, I do not want to be involved in projects that show up such
ridiculous flaws.
Updated by hsbt (Hiroshi SHIBATA) 4 days ago
- Status changed from Open to Closed
We should handle this on https://github.com/ruby/net-http.