Project

General

Profile

Actions

Bug #18077

closed

Marshal.dump(closed_io) raises IOError instead of TypeError

Added by larskanis (Lars Kanis) about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.0dev (2021-08-16T08:00:19Z master a8714b83c4) [x86_64-linux]
[ruby-core:104927]

Description

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 `<main>'

This issue is present in all current ruby versions.

Actions

Also available in: Atom PDF