Skip to content

eval_error.c: Depracate error message escaping#5195

Open
mame wants to merge 1 commit intoruby:masterfrom
mame:deprecate-error-message-escaping
Open

eval_error.c: Depracate error message escaping#5195
mame wants to merge 1 commit intoruby:masterfrom
mame:deprecate-error-message-escaping

Conversation

@mame
Copy link
Copy Markdown
Member

@mame mame commented Nov 30, 2021

Currently, Ruby's error printer escapes an error message.

$ ruby -e 'raise "foo\\bar"'
-e:1:in `<main>': foo\\bar (RuntimeError)

This change stops the behavior.

$ ruby -e 'raise "foo\\bar"'
-e:1:in `<main>': foo\bar (RuntimeError)

As a migration path, the behavior is kept when the message includes any
control character, with a warning is also printed.

$ ruby -e 'raise "\0"'
-e: warning: this error message is currently escaped because it includes control characters, but this will not be escaped in Ruby 3.3
-e:1:in `<main>': \0 (RuntimeError)

[Feature #18367]

Currently, Ruby's error printer escapes an error message.

```
$ ruby -e 'raise "foo\\bar"'
-e:1:in `<main>': foo\\bar (RuntimeError)
```

This change stops the behavior.

```
$ ruby -e 'raise "foo\\bar"'
-e:1:in `<main>': foo\bar (RuntimeError)
```

As a migration path, the behavior is kept when the message includes any
control character, with a warning is also printed.

```
$ ruby -e 'raise "\0"'
-e: warning: this error message is currently escaped because it includes control characters, but this will not be escaped in Ruby 3.3
-e:1:in `<main>': \0 (RuntimeError)
```

[Feature #18367]
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.

1 participant