Project

General

Profile

Actions

Backport #6055

closed

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

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

Status:
Closed
[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 1 (0 open1 closed)

Has duplicate Ruby master - Bug #6500: File#open with a ':binmode => true' optRejectedh.shirosaki (Hiroshi Shirosaki)05/26/2012Actions
Actions #1

Updated by nobu (Nobuyoshi Nakada) over 12 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]
Actions #2

Updated by usa (Usaku NAKAMURA) over 12 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によるとバックポート必要な模様。

Actions #3

Updated by naruse (Yui NARUSE) over 12 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]
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0