Project

General

Profile

Actions

Bug #18881

closed

IO#read_nonblock raises IOError when called following buffered character IO

Added by javanthropus (Jeremy Bopp) almost 2 years ago. Updated over 1 year ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]
[ruby-core:109055]

Description

The following example code works as expected on Linux but raises an IOError on Windows:

r, w = IO.pipe
w.write("foobar")
c = r.getc
r.ungetc(c)
r.read_nonblock(3)

The error message is:

IOError: byte oriented read for character buffered IO
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0