[ruby-core:122729] [Ruby Bug#21509] io/wait: IO#wait raises error when passed nil as timeout

Issue #21509 has been reported by chucke (Tiago Cardoso). ---------------------------------------- Bug #21509: io/wait: IO#wait raises error when passed nil as timeout https://bugs.ruby-lang.org/issues/21509 * Author: chucke (Tiago Cardoso) * Status: Open * ruby -v: 3.4.4 * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- The [documentation of the method](https://ruby-doc.org/3.4.1/exts/io/wait/IO.html#method-i-wait) 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 -- https://bugs.ruby-lang.org/
participants (1)
-
chucke (Tiago Cardoso)