Project

General

Profile

Actions

Bug #18160

closed

IndexError raised from MatchData#{offset,begin,end} does not keep the encoding of the argument

Added by nobu (Nobuyoshi Nakada) over 3 years ago. Updated about 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:105204]

Description

m = /.*/.match("foo")
m.offset("\u{3042}") rescue p $!.message
#=> "undefined group name reference: \xE3\x81\x82"
Actions #1

Updated by nobu (Nobuyoshi Nakada) over 3 years ago

  • Status changed from Open to Closed

Applied in changeset git|99d8c4832a7133ca52578d015e3ddcfd94820f4a.


Preserve the encoding of the argument in IndexError [Bug #18160]

Updated by nagachika (Tomoyuki Chikanaga) over 3 years ago

  • Backport changed from 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED to 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONE

ruby_3_0 3e61556191ea7e6586ffb995f03e6d2631ec6fb0 merged revision(s) 99d8c4832a7133ca52578d015e3ddcfd94820f4a.

Updated by usa (Usaku NAKAMURA) about 3 years ago

  • Backport changed from 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONE to 2.6: REQUIRED, 2.7: DONE, 3.0: DONE

ruby_2_7 cd10572b059d07fe236ef9c9db9fd2a8ffc7dd38 merged revision(s) 99d8c4832a7133ca52578d015e3ddcfd94820f4a.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0