-
Notifications
You must be signed in to change notification settings - Fork 185
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
net-imap 0.4.0 Regexp Error #3287
Comments
It looks this was already fixed in Joni. At least JRuby 9.4.3.0 isn't affected. We're using Joni 2.1.44 but the latest is 2.2.1. Even if we wanted to stick with the 2.1.x line, the latest there is 2.1.48. |
Looking at the exception message, we see the following Regexp: /(?-mix:[\x00-\x7f])|(?-mix:[\xC2-\xDF](?-mix:[\x80-\xBF]))|(?-mix:(?-mix:\xE0[\xA0-\xBF](?-mix:[\x80-\xBF]))|(?-mix:\xED[\x80-\x9F](?-mix:[\x80-\xBF]))|(?-mix:[\xE1-\xEC][\x80-\xBF][\x80-\xBF])|(?-mix:[\xEE-\xEF][\x80-\xBF][\x80-\xBF]))|(?-mix:(?-mix:[\xF1-\xF3][\x80-\xBF][\x80-\xBF][\x80-\xBF])|(?-mix:\xF0[\x90-\xBF][\x80-\xBF][\x80-\xBF])|(?-mix:\xF4[\x80-\x8F][\x80-\xBF][\x80-\xBF]))/ It's possible the exception message is missing context, but that is indeed an invalid regex. It needs to have the /(?-mix:[\x00-\x7f])|(?-mix:[\xC2-\xDF](?-mix:[\x80-\xBF]))|(?-mix:(?-mix:\xE0[\xA0-\xBF](?-mix:[\x80-\xBF]))|(?-mix:\xED[\x80-\x9F](?-mix:[\x80-\xBF]))|(?-mix:[\xE1-\xEC][\x80-\xBF][\x80-\xBF])|(?-mix:[\xEE-\xEF][\x80-\xBF][\x80-\xBF]))|(?-mix:(?-mix:[\xF1-\xF3][\x80-\xBF][\x80-\xBF][\x80-\xBF])|(?-mix:\xF0[\x90-\xBF][\x80-\xBF][\x80-\xBF])|(?-mix:\xF4[\x80-\x8F][\x80-\xBF][\x80-\xBF]))/n It looks like our implementation of UTF8_1 = /[\x00-\x7f]/n # aka ASCII 7bit
UTF8_TAIL = /[\x80-\xBF]/n
UTF8_2 = /[\xC2-\xDF]#{UTF8_TAIL}/n
Regexp.union(UTF8_1, UTF8_2).encoding On MRI, we see the encoding is |
Fixed by #3296 |
This fix will be in the 23.1.2 release which will be available on January 23, 2024. |
net-imap 0.4.0 was released on 2023-10-04 and it fails to load on TruffleRuby 23.1.0. This is particularly a problem because it's a dependency of ActionMailbox and Rails 7.1.0 just released. Anyone looking to start a Rails project with TruffleRuby is likely to run into this.
The code in question is related to a new UTF-8 handling:
Taken from: https://github.com/ruby/net-imap/blob/v0.4.0/lib/net/imap/response_parser.rb#L116-L126.
Added in net-imap PR #111. Related commit.
The text was updated successfully, but these errors were encountered: