CARVIEW |
Select Language
HTTP/2 200
x-amz-id-2: iLtBKsqramPDWivk1owxBNhCpmxP3JPxTwvxnJ13wfls1ZEoCIDz2nhHrDGiRAhaqQECvYQcQL4=
x-amz-request-id: HN93GERHFHKS2FWY
last-modified: Tue, 01 Jul 2025 07:02:24 GMT
etag: "6aae8b3c688209c52877cd6fc1337bf0"
x-amz-server-side-encryption: AES256
server: AmazonS3
content-encoding: gzip
via: 1.1 varnish, 1.1 varnish
content-type: text/plain; charset=utf-8
accept-ranges: bytes
age: 0
date: Wed, 23 Jul 2025 13:10:55 GMT
x-served-by: cache-tyo11926-TYO, cache-bom-vanm7210061-BOM
x-cache: MISS, MISS
x-cache-hits: 0, 0
x-timer: S1753276255.245779,VS0,VE391
vary: Accept-Encoding
content-length: 759
From: "dE (dE Techno) via ruby-core"
Date: 2025-07-01T06:57:16+00:00
Subject: [ruby-core:122636] [Ruby Bug#21495] IO.read_nonblock does not work under a rescue IO::TimeoutError
Issue #21495 has been reported by dE (dE Techno).
----------------------------------------
Bug #21495: IO.read_nonblock does not work under a rescue IO::TimeoutError
https://bugs.ruby-lang.org/issues/21495
* Author: dE (dE Techno)
* Status: Open
* ruby -v: de@myworkstation ~/docs/Practice/Software/ruby $ ruby -v ruby 3.2.8 (2025-03-26 revision 13f495dc2c) [x86_64-linux]
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
In this particular code --
``` ruby
execArg = 'echo testwrite; sleep 5'
tofuProcess = IO.popen(execArg, 'r')
puts 'executed tofu process.'
tofuProcess.timeout=2
begin
tofuOut = tofuProcess.read
rescue IO::TimeoutError
puts 'rescue occured'
begin
tofuOut = tofuProcess.read_nonblock(1)
rescue IO::EAGAINWaitReadable
puts 'no data in read buffer!'
end
tofuProcess.close
puts 'process closed'
end
```
tofuProcess.read_nonblock(1) must return a character because the underlying process has produced an output. But it raises a IO::EAGAINWaitReadable exception instead which does not happen outside a rescue IO::TimeoutError block
--
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/