Skip to content

run with stdin=IOBuffer(str) doesn't work with str a substring #36406

Closed
@c42f

Description

@c42f

The following pipeline works as expected:

julia> run(pipeline(`cat`, stdin=IOBuffer("Hello world\n")))
Hello world
Process(`cat`, ProcessExited(0))

But if the IOBuffer contains a substring (eg, from split) a method error occurs:

julia> run(pipeline(`cat`, stdin=IOBuffer(SubString("Hello world\n"))))
ERROR: MethodError: no method matching rawhandle(::Base.GenericIOBuffer{SubArray{UInt8,1,Array{UInt8,1},Tuple{UnitRange{Int64}},true}})
Closest candidates are:
  rawhandle(::RawFD) at cmd.jl:161
  rawhandle(::Base.DevNull) at cmd.jl:160
  rawhandle(::Base.Filesystem.File) at filesystem.jl:75

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorioInvolving the I/O subsystem: libuv, read, write, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions