Project

General

Profile

Actions

Bug #11827

closed

StringIO with set_encoding broken with enabled frozen string literal

Added by deepj (deepj #) over 8 years ago. Updated over 8 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0preview2 (2015-12-11 trunk 53028) [x86_64-darwin15]
[ruby-core:72189]

Description

I'm not sure if this the following problem is an expected behavior. But I guess, it is a bug when I run the code below. It throws `set_encoding': can't modify frozen String (RuntimeError).

# frozen_string_literal: true

io = StringIO.new('')
io.set_encoding(Encoding::BINARY)

I wouldn't expect this kind of behavior.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0