From: "rhenium (Kazuki Yamaguchi) via ruby-core" Date: 2026-10-10T17:27:47+00:00 Subject: [ruby-core:127063] [Ruby Bug#22424] IO#readpartial and IO#sysread should respect IO#timeout= value Issue #22424 has been reported by rhenium (Kazuki Yamaguchi). ---------------------------------------- Bug #22424: IO#readpartial and IO#sysread should respect IO#timeout= value https://bugs.ruby-lang.org/issues/22424 * Author: rhenium (Kazuki Yamaguchi) * Status: Open * Backport: 3.3: UNKNOWN, 3.4: REQUIRED, 4.0: REQUIRED ---------------------------------------- I expected `IO#readpartial` and `IO#sysread` to respect `IO#timeout=` and raise `IO::TimeoutError`, but they currently ignore it and block indefinitely: ```ruby IO.pipe{|r,w|r.timeout=1; r.read(1)} # raises IO::TimeoutError after 1 second, as expected IO.pipe{|r,w|r.timeout=1; r.gets(1)} # raises IO::TimeoutError after 1 second, as expected IO.pipe{|r,w|r.timeout=1; r.sysread(1)} # blocks indefinitely IO.pipe{|r,w|r.timeout=1; r.readpartial(1)} # blocks indefinitely ``` This appears to be a simple omission in commit:e4f91bbdbaa6ab3125f24967414ac5300bb244f5 (the original commit that added `IO#timeout=`, [Feature #18630]). -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/