Skip to content

Commit 751bacb

Browse files
authored
[rb] Resolve uri gem deprecation warning (#14770)
> /home/user/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/selenium-webdriver-4.26.0/lib/selenium/webdriver/remote/bridge.rb:679: warning: URI::RFC3986_PARSER.escape is obsoleted. Use URI::RFC2396_PARSER.escape explicitly. Ruby switches the default parser from RFC2396 to RFC3986. This parser contains all methods from the old parser but delegates to RFC2396 for a few and warns. Namely `extract`, `make_regexp`, `escape`, and `unescape`. selenium currently supports Ruby >= 3.1, so the current old compatibility code is unnecessary. `RFC2396_PARSER` is a somewhat new addition, so some kind of check is still needed. It is available in Ruby 3.1 but early patch versions are missing it.
1 parent b164d85 commit 751bacb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rb/lib/selenium/webdriver/remote/bridge.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ def execute(command, opts = {}, command_hash = nil)
686686
end
687687

688688
def escaper
689-
@escaper ||= defined?(URI::Parser) ? URI::DEFAULT_PARSER : URI
689+
@escaper ||= defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::DEFAULT_PARSER
690690
end
691691

692692
def commands(command)

0 commit comments

Comments
 (0)