Skip to content

StringIO#seek should work even if String is frozen #119

Closed
@headius

Description

@headius

A regression from #116 only in the JRuby extension.

TestCSVInterfaceReadWrite::DifferentOFS#test_filter:
IOError: not modifiable string
    org/jruby/ext/stringio/StringIO.java:1350:in `seek'
    /Users/headius/work/jruby/lib/ruby/stdlib/csv/parser.rb:683:in `resolve_row_separator'
    /Users/headius/work/jruby/lib/ruby/stdlib/csv/parser.rb:576:in `prepare_separators'
    /Users/headius/work/jruby/lib/ruby/stdlib/csv/parser.rb:442:in `prepare'
    /Users/headius/work/jruby/lib/ruby/stdlib/csv/parser.rb:329:in `initialize'
    org/jruby/RubyClass.java:936:in `new'
    /Users/headius/work/jruby/lib/ruby/stdlib/csv.rb:2824:in `parser'
    /Users/headius/work/jruby/lib/ruby/stdlib/csv.rb:2833:in `parser_enumerator'
    /Users/headius/work/jruby/lib/ruby/stdlib/csv.rb:2554:in `each'
    /Users/headius/work/jruby/lib/ruby/stdlib/csv.rb:1239:in `filter'
    /Users/headius/work/jruby/test/mri/csv/interface/test_read_write.rb:14:in `test_filter'

This CVS test creates a StringIO using a frozen String and later calls StringIO#seek. Changes in #116 incorrectly checked if the String is frozen and raised an error.

The StringIO#seek definition in the JRuby extension shall be modified to allow frozen Strings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions