Issue #22413 has been reported by rhenium (Kazuki Yamaguchi). ---------------------------------------- Bug #22413: IO#wait_readable does not distinguish nil from an omitted timeout https://bugs.ruby-lang.org/issues/22413 * Author: rhenium (Kazuki Yamaguchi) * Status: Open * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- I was expecting `io.wait_readable(nil)` to wait indefinitely, but it is currently treated the same as omitting the argumen, so the value set by `IO#timeout=` is used: ```ruby IO.pipe{|r,w|r.timeout=1; r.wait_readable} # returns after 1 second, as expected IO.pipe{|r,w|r.timeout=1; r.wait_readable(nil)} # also returns after 1 second ``` Is this the intended behavior? Is `io.wait_readable(nil)` supposed to be a valid call at all, or is `nil` accepted only because of a loose argument check? The documentation for `IO#wait`, `IO#wait_readable`, and `IO#wait_writable` does not explain how the timeout parameter is handled. -- https://bugs.ruby-lang.org/