Project

General

Profile

Actions

Bug #5918

closed

IO.new accepts some conflicting binmode specifiers

Bug #5918: IO.new accepts some conflicting binmode specifiers

Added by john_firebaugh (John Firebaugh) almost 14 years ago. Updated almost 14 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]
Backport:
[ruby-core:42199]

Description

=begin
Accepted: "wb" + :binmode => false
Accepted: "wt" + :textmode => false

These should not be accepted because they are clearly conflicting.

In fact, I would argue that any combination of mode specifier in both the mode string and options should raise ArgumentError (conflicting or not), to match the behavior when encoding specifiers in both the mode string and options:

IO.new(0, 'w:ISO-8859-1', :encoding => 'ISO-8859-1') #=> ArgumentError: encoding specified twice
=end

Updated by naruse (Yui NARUSE) almost 14 years ago Actions #1

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r34359.
John, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • io.c (extract_binmode): raise an exception if binmode/textmode
    is specified with both vmode and opthash.
    [ruby-core:42199] [Bug #5918]
Actions

Also available in: PDF Atom