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

Address warning: URI::RFC3986_PARSER warnings #1620

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yahonda
Copy link
Contributor

@yahonda yahonda commented Oct 22, 2024

This commit addresses the following warnings against Ruby 3.4.0.preview 2 below.

  • Ruby version tested
$ ruby -v
ruby 3.4.0preview2 (2024-10-07 master 32c733f57b) +PRISM [x86_64-linux]
  • Warnings without this commit
/path/to/mail/lib/mail/spec/mail/attachments_list_spec.rb:179: warning: URI::RFC3986_PARSER.escape is obsoleted. Use URI::RFC2396_PARSER.escape explicitly.
/path/to/mail/lib/mail/spec/mail/utilities_spec.rb:386: warning: URI::RFC3986_PARSER.escape is obsoleted. Use URI::RFC2396_PARSER.escape explicitly.
/path/to/mail/lib/mail/spec/mail/utilities_spec.rb:390: warning: URI::RFC3986_PARSER.unescape is obsoleted. Use URI::RFC2396_PARSER.unescape explicitly.
/path/to/mail/lib/mail/utilities.rb:160: warning: URI::RFC3986_PARSER.escape is obsoleted. Use URI::RFC2396_PARSER.escape explicitly.
/path/to/mail/lib/mail/utilities.rb:164: warning: URI::RFC3986_PARSER.unescape is obsoleted. Use URI::RFC2396_PARSER.unescape explicitly.
/path/to/mail/lib/mail/utilities.rb:452: warning: URI::RFC3986_PARSER.unescape is obsoleted. Use URI::RFC2396_PARSER.unescape explicitly.
/path/to/mail/lib/mail/utilities.rb:463: warning: URI::RFC3986_PARSER.escape is obsoleted. Use URI::RFC2396_PARSER.escape explicitly.

Ruby 3.4 changes URI::DEFAULT_PARSER to URI::RFC3986_Parser and deprecates some methods. URI::RFC3986_PARSER.make_regexp and URI::RFC3986_PARSER.make_regexp are used in the mail gem.

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

Refer to https://bugs.ruby-lang.org/issues/19266

This commit addresses the following warnings below.

```
/path/to/mail/lib/mail/spec/mail/attachments_list_spec.rb:179: warning: URI::RFC3986_PARSER.escape is obsoleted. Use URI::RFC2396_PARSER.escape explicitly.
/path/to/mail/lib/mail/spec/mail/utilities_spec.rb:386: warning: URI::RFC3986_PARSER.escape is obsoleted. Use URI::RFC2396_PARSER.escape explicitly.
/path/to/mail/lib/mail/spec/mail/utilities_spec.rb:390: warning: URI::RFC3986_PARSER.unescape is obsoleted. Use URI::RFC2396_PARSER.unescape explicitly.
/path/to/mail/lib/mail/utilities.rb:160: warning: URI::RFC3986_PARSER.escape is obsoleted. Use URI::RFC2396_PARSER.escape explicitly.
/path/to/mail/lib/mail/utilities.rb:164: warning: URI::RFC3986_PARSER.unescape is obsoleted. Use URI::RFC2396_PARSER.unescape explicitly.
/path/to/mail/lib/mail/utilities.rb:452: warning: URI::RFC3986_PARSER.unescape is obsoleted. Use URI::RFC2396_PARSER.unescape explicitly.
/path/to/mail/lib/mail/utilities.rb:463: warning: URI::RFC3986_PARSER.escape is obsoleted. Use URI::RFC2396_PARSER.escape explicitly.
```

Ruby 3.4 changes URI::DEFAULT_PARSER to URI::RFC3986_Parser and deprecates some methods.
URI::RFC3986_PARSER.make_regexp and URI::RFC3986_PARSER.make_regexp are used in the mail gem.

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

https://bugs.ruby-lang.org/issues/19266
@rgaufman
Copy link

I'm getting this deprecation too, please marge.

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 this pull request may close these issues.

2 participants