Skip to content
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

URI::DEFAULT_PARSER.make_regexp is deprecated in Ruby 3.4.0-preview2 #2778

Open
jeremyevans opened this issue Oct 9, 2024 · 0 comments · May be fixed by #2781
Open

URI::DEFAULT_PARSER.make_regexp is deprecated in Ruby 3.4.0-preview2 #2778

jeremyevans opened this issue Oct 9, 2024 · 0 comments · May be fixed by #2781

Comments

@jeremyevans
Copy link
Contributor

Capybara calls the method in a couple places:

This results in a verbose-mode warning when using Ruby 3.4.0-preview2:

lib/capybara/session/config.rb:95: warning: URI::RFC3986_PARSER.make_regexp is obsoleted. Use URI::RFC2396_PARSER.make_regexp explicitly.

We recently worked around this issue in Rack (rack/rack@3d0b9f3), you may want to use a similar approach.

yahonda added a commit to yahonda/capybara that referenced this issue Oct 12, 2024
…RI::RFC2396_PARSER.make_regexp explicitly.` warning

This commit addresses `warning: URI::RFC3986_PARSER.make_regexp is obsoleted. Use URI::RFC2396_PARSER.make_regexp explicitly.` warning

Ruby 3.4 changes URI::DEFAULT_PARSER to URI::RFC3986_Parser and deprecates URI::RFC3986_PARSER.make_regexp.

This commit uses `URI::RFC2396_PARSER` only if it is available for these versions:

- `uri` v0.12.2 for Ruby 3.2/3.1
- `uri` v0.13.1 for Ruby 3.3
- Ruby 3.4.0dev

Fix teamcapybara#2778
Refer https://bugs.ruby-lang.org/issues/19266
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant