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) about 14 years ago. Updated about 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

Actions

Also available in: PDF Atom