Backport #6055
IO.foreach 等で binmode:true を指定すると例外
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
Associated revisions
- io.c (rb_io_extract_modeenc): fail only if conflicting text/binary modes given explicitly. [ruby-dev:45268][Bug #6055]
- io.c (rb_io_extract_modeenc): fail only if conflicting text/binary modes given explicitly. [ruby-dev:45268][Bug #6055]
- io.c (rb_io_extract_modeenc): fail only if conflicting text/binary modes given explicitly. [ruby-dev:45268][Bug #6055]
- io.c (rb_io_extract_modeenc): fail only if conflicting text/binary modes given explicitly. [ruby-dev:45268][Bug #6055]
- io.c (rb_io_extract_modeenc): fail only if conflicting text/binary modes given explicitly. [ruby-dev:45268][Bug #6055]
- io.c (rb_io_extract_modeenc): fail only if conflicting text/binary modes given explicitly. [ruby-dev:45268][Bug #6055]
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
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
Updated by nobu (Nobuyoshi Nakada) almost 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]
Updated by usa (Usaku NAKAMURA) over 6 years ago
- Tracker changed from Bug to Backport
- Project changed from Ruby trunk to Backport193
- Status changed from Closed to Assigned
- Assignee set to naruse (Yui NARUSE)
#6500によるとバックポート必要な模様。
Updated by naruse (Yui NARUSE) over 6 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]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e