-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rb] Resolve uri
gem deprecation warning
#14770
[rb] Resolve uri
gem deprecation warning
#14770
Conversation
> /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.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation reference for this change: https://bugs.ruby-lang.org/issues/19266
Thank you @Earlopain for your contribution! Have a great day! |
Thanks (: You have a good one as well |
User description
Description
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
, andunescape
.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.Motivation and Context
Types of changes
Checklist
PR Type
Bug fix
Description
escaper
method inbridge.rb
to resolve a deprecation warning by usingURI::RFC2396_PARSER
when available.URI::RFC2396_PARSER
.URI::RFC3986_PARSER.escape
.Changes walkthrough 📝
bridge.rb
Resolve deprecation warning by updating URI parser usage
rb/lib/selenium/webdriver/remote/bridge.rb
escaper
method to useURI::RFC2396_PARSER
if defined.URI::DEFAULT_PARSER
ifURI::RFC2396_PARSER
is not defined.