Project

General

Profile

Backport #6055

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

Added by wanabe (_ wanabe) about 8 years ago. Updated almost 8 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/2012h.shirosaki (Hiroshi Shirosaki)Actions
#1

Updated by nobu (Nobuyoshi Nakada) about 8 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) almost 8 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) almost 8 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