From: "larskanis (Lars Kanis)" Date: 2021-08-16T11:33:04+00:00 Subject: [ruby-core:104927] [Ruby master Bug#18077] Marshal.dump(closed_io) raises IOError instead of TypeError Issue #18077 has been reported by larskanis (Lars Kanis). ---------------------------------------- Bug #18077: Marshal.dump(closed_io) raises IOError instead of TypeError https://bugs.ruby-lang.org/issues/18077 * Author: larskanis (Lars Kanis) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.0dev (2021-08-16T08:00:19Z master a8714b83c4) [x86_64-linux] * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- Marshal.dump is expected to raise a `TypeError` for unmarshallable objects. But closed streams raise an `IOError`: ``` $ ruby -e "io=IO.pipe.first; io.close; Marshal.dump(io)" -e:1:in `internal_encoding': closed stream (IOError) from -e:1:in `dump' from -e:1:in `
' ``` This issue is present in all current ruby versions. -- https://bugs.ruby-lang.org/ Unsubscribe: