-
Notifications
You must be signed in to change notification settings - Fork 2.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
Respect Regexp.compile method signature #9351
Conversation
Can one of the admins verify this patch? |
I believe if encoding
Puppet.warn_once(
'deprecations', 'regsubst_function_encoding',
_("The regsubst() function's encoding argument has been ignored since Ruby 1.9 and will be removed in a future release")
)
end |
5a954a5
to
3b8f19e
Compare
So something like this? |
Something changed with GH Windows runners (see #9371) causing the test failures. Could you rebase on |
Since Ruby 1.9 the encoding argument to Regexp.compile has been ignored and has been removed since. Starting Ruby 3.2 there is a new third positional argument for the timeout. This PR deprecates the old method with encoding and stops passing the argument, making it a dead parameter.
3b8f19e
to
f4fa383
Compare
Trivial rebase done. |
It's green now. |
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.
Thanks @ekohl!
As far as I can tell, Regexp.compile has never accepted a third parameter to Regexp.compile until Ruby 3.2. There it actually is a timeout parameter. In older versions it was discarded as an invalid input. It's unclear to me if this parameter ever worked in the first place.
This PR attemps to still make it work as it was originally intended, but it's unclear what the original goal even was. Perhaps it's better to make an incompatible change to drop the third parameter and instead enhance the flags parameter to support
N
as a value.