Project

General

Profile

Actions

Bug #21509

closed

io/wait: IO#wait raises error when passed nil as timeout

Added by chucke (Tiago Cardoso) 3 days ago. Updated 2 days ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:122729]

Description

The documentation of the method goes:

wait(timeout = nil, mode = :read) → self, true, or false 

However, when passing nil in the first argument, it fails:

io.wait(nil, :read_write) #=> in 'IO#wait': can't convert NilClass into time interval (TypeError)

This seems inconsistent with other variants and related methods:

io.wait(IO::READABLE | IO::WRITABLE, nil) #=> 5
io.to_io.wait_readable(nil) #=> returns the socket
Actions #1

Updated by nobu (Nobuyoshi Nakada) 2 days ago

  • Status changed from Open to Closed

Applied in changeset git|dbf7a0c713c39bdfd22c24e69f4bb0b89c9cab65.


[ruby/io-wait] [Bug #21509] [DOC] Correct IO#wait description

https://github.com/ruby/io-wait/commit/c65af887a1

Actions

Also available in: Atom PDF

Like0
Like0