* [ruby-dev:50907] [Ruby master Bug#16469] Wrong warning message at `URI.encode` and `URI.decode`
[not found] <redmine.issue-16469.20200101120857@ruby-lang.org>
@ 2020-01-01 12:08 ` sue445fukuoka
2020-01-07 17:53 ` [ruby-dev:50908] " merch-redmine
1 sibling, 0 replies; 2+ messages in thread
From: sue445fukuoka @ 2020-01-01 12:08 UTC (permalink / raw)
To: ruby-dev
Issue #16469 has been reported by sue445 (Go Sueyoshi).
----------------------------------------
Bug #16469: Wrong warning message at `URI.encode` and `URI.decode`
https://bugs.ruby-lang.org/issues/16469
* Author: sue445 (Go Sueyoshi)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin17], ruby 2.8.0dev (2020-01-01T06:06:19Z master afd3f64f8c) [x86_64-darwin17]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
# Sample code
``` ruby
enc_uri = URI.encode("http://example.com/?a=\11\15")
URI.decode(enc_uri)
```
# Actual
```ruby
irb(main):005:0> enc_uri = URI.encode("http://example.com/?a=\11\15")
(irb):3: warning: URI.escape is obsolete
irb(main):006:0> URI.decode(enc_uri)
(irb):6: warning: URI.unescape is obsolete
=> "http://example.com/?a=\t\r"
```
# Expected
Print `warning: URI.encode is obsolete` and `warning: URI.decode is obsolete` . (or no warnings)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
* [ruby-dev:50908] [Ruby master Bug#16469] Wrong warning message at `URI.encode` and `URI.decode`
[not found] <redmine.issue-16469.20200101120857@ruby-lang.org>
2020-01-01 12:08 ` [ruby-dev:50907] [Ruby master Bug#16469] Wrong warning message at `URI.encode` and `URI.decode` sue445fukuoka
@ 2020-01-07 17:53 ` merch-redmine
1 sibling, 0 replies; 2+ messages in thread
From: merch-redmine @ 2020-01-07 17:53 UTC (permalink / raw)
To: ruby-dev
Issue #16469 has been updated by jeremyevans0 (Jeremy Evans).
We can probably use `__callee__` instead of hard coding the method names, that should fix this issue:
```diff
diff --git a/lib/uri/common.rb b/lib/uri/common.rb
index b886923c9e..e3ed405857 100644
--- a/lib/uri/common.rb
+++ b/lib/uri/common.rb
@@ -99,7 +99,7 @@ module Escape
# # => "@%3F@%21"
#
def escape(*arg)
- warn "URI.escape is obsolete", uplevel: 1
+ warn "URI.#{__callee__} is obsolete", uplevel: 1
DEFAULT_PARSER.escape(*arg)
end
alias encode escape
@@ -130,7 +130,7 @@ def escape(*arg)
# # => "http://example.com/?a=\t\r"
#
def unescape(*arg)
- warn "URI.unescape is obsolete", uplevel: 1
+ warn "URI.#{__callee__} is obsolete", uplevel: 1
DEFAULT_PARSER.unescape(*arg)
end
alias decode unescape
```
----------------------------------------
Bug #16469: Wrong warning message at `URI.encode` and `URI.decode`
https://bugs.ruby-lang.org/issues/16469#change-83692
* Author: sue445 (Go Sueyoshi)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin17], ruby 2.8.0dev (2020-01-01T06:06:19Z master afd3f64f8c) [x86_64-darwin17]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
# Sample code
``` ruby
enc_uri = URI.encode("http://example.com/?a=\11\15")
URI.decode(enc_uri)
```
# Actual
```ruby
irb(main):005:0> enc_uri = URI.encode("http://example.com/?a=\11\15")
(irb):3: warning: URI.escape is obsolete
irb(main):006:0> URI.decode(enc_uri)
(irb):6: warning: URI.unescape is obsolete
=> "http://example.com/?a=\t\r"
```
# Expected
Print `warning: URI.encode is obsolete` and `warning: URI.decode is obsolete` . (or no warnings)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-07 17:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <redmine.issue-16469.20200101120857@ruby-lang.org>
2020-01-01 12:08 ` [ruby-dev:50907] [Ruby master Bug#16469] Wrong warning message at `URI.encode` and `URI.decode` sue445fukuoka
2020-01-07 17:53 ` [ruby-dev:50908] " merch-redmine
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).