-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
ioInvolving the I/O subsystem: libuv, read, write, etc.Involving the I/O subsystem: libuv, read, write, etc.
Description
Following up on #12050 (comment),
I would like to propose that we change redirect_stdout to allow this:
julia> redirect_stdout(DevNull)
ERROR: MethodError: no method matching redirect_stdout(::Base.DevNullStream)
Closest candidates are:
redirect_stdout() at stream.jl:1034
redirect_stdout(::Union{Base.LibuvStream, IOStream}) at stream.jl:1028
redirect_stdout(::Function, ::Any) at stream.jl:1082
Right now,
DevNull <: DevNullStream <: IO <: Any,
open("/tmp/foo", "w") <: IOStream <: IO <: Any,
STDOUT <: TTY <: LibuvStream <: IO <: Any
The latter two are allowed with redirect_stdout per the second method listed, but DevNull isn't.
(Is there a reason that redirect_stdout can't accept IO? That would resolve this issue and make things more consistent.)
Metadata
Metadata
Assignees
Labels
ioInvolving the I/O subsystem: libuv, read, write, etc.Involving the I/O subsystem: libuv, read, write, etc.