Project

General

Profile

Backport #6055

IO.foreach 等で binmode:true を指定すると例外

Added by wanabe (_ wanabe) over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
[ruby-dev:45268]

Description

http://toro.2ch.net/test/read.cgi/tech/1324826777/666-675 で指摘があったのですが
Windows で IO.foreach や IO.read などで mode を指定せずに binmode:true を指定すると例外が発生するそうです。
(試していません。すみません)

元の書き込みを参考に処理を追うと、rb_io_extract_modeenc で、mode 指定がないときには DEFAULT_TEXTMODE を付与していますが
その処理の後で extract_binmode 呼び出しがあり、FMODE_BINMODE も同時に付与されてしまう、という流れのように見えます。


Related issues

Has duplicate Ruby master - Bug #6500: File#open with a ':binmode => true' optRejected05/26/2012Actions

Associated revisions

Revision 4341c58c
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • io.c (rb_io_extract_modeenc): fail only if conflicting text/binary modes given explicitly. [ruby-dev:45268][Bug #6055]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 34753
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • io.c (rb_io_extract_modeenc): fail only if conflicting text/binary modes given explicitly. [ruby-dev:45268][Bug #6055]

Revision 34753
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • io.c (rb_io_extract_modeenc): fail only if conflicting text/binary modes given explicitly. [ruby-dev:45268][Bug #6055]

Revision 34753
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • io.c (rb_io_extract_modeenc): fail only if conflicting text/binary modes given explicitly. [ruby-dev:45268][Bug #6055]

Revision 34753
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • io.c (rb_io_extract_modeenc): fail only if conflicting text/binary modes given explicitly. [ruby-dev:45268][Bug #6055]

Revision 34753
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • io.c (rb_io_extract_modeenc): fail only if conflicting text/binary modes given explicitly. [ruby-dev:45268][Bug #6055]

Revision 34753
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • io.c (rb_io_extract_modeenc): fail only if conflicting text/binary modes given explicitly. [ruby-dev:45268][Bug #6055]

Revision 1d0ddd42
Added by naruse (Yui NARUSE) over 7 years ago

merge revision(s) 34753:

    * io.c (rb_io_extract_modeenc): fail only if conflicting
      text/binary modes given explicitly.  [ruby-dev:45268][Bug #6055]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 35826
Added by naruse (Yui NARUSE) over 7 years ago

merge revision(s) 34753:

* io.c (rb_io_extract_modeenc): fail only if conflicting
  text/binary modes given explicitly.  [ruby-dev:45268][Bug #6055]

History

#1

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

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

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


  • io.c (rb_io_extract_modeenc): fail only if conflicting text/binary modes given explicitly. [ruby-dev:45268][Bug #6055]
#2

Updated by usa (Usaku NAKAMURA) over 7 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport193
  • Status changed from Closed to Assigned
  • Assignee set to naruse (Yui NARUSE)

#6500によるとバックポート必要な模様。

#3

Updated by naruse (Yui NARUSE) over 7 years ago

  • Status changed from Assigned to Closed

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


merge revision(s) 34753:

* io.c (rb_io_extract_modeenc): fail only if conflicting
  text/binary modes given explicitly.  [ruby-dev:45268][Bug #6055]

Also available in: Atom PDF