Actions
Bug #21509
closedio/wait: IO#wait raises error when passed nil as timeout
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
Like0
Like0