Project

General

Profile

Actions

Bug #10886

closed

String#split now throws a RegexpError instead of an ArgumentError

Added by Eregon (Benoit Daloze) about 9 years ago. Updated about 9 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
[ruby-core:68229]

Description

ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-linux]
-e:1:in `split': invalid byte sequence in UTF-8 (ArgumentError)
	from -e:1:in `<main>'

ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
-e:1:in `split': invalid multibyte character: /\xFF/ (RegexpError)
	from -e:1:in `<main>'

This is leaking implementation details and so I think is a bug as such.
The bug was discovered thanks to https://github.com/rubyspec/rubyspec/blob/archive/core/string/split_spec.rb#L16-L23.

Actions

Also available in: Atom PDF

Like0
Like0Like0