Skip to content

Error setting mixed type Cmd environment #56780

Open
@KSepetanc

Description

Opening an issue as suggested on discourse.

The following command results in error because it has mixed strings and integers.

Cmd(ampl PF.run,env=("param1"=>1,"param2"=>"abc"))

ERROR: MethodError: no method matching byteenv(::Tuple{Pair{String, Int64}, Pair{String, String}})

Closest candidates are:
  byteenv(::Nothing)
   @ Base cmd.jl:249
  byteenv(::Union{AbstractArray{Pair{T, V}, 1}, Tuple{Vararg{Pair{T, V}}}}) where {T<:AbstractString, V}
   @ Base cmd.jl:250
  byteenv(::AbstractDict)
   @ Base cmd.jl:247
  ...

Stacktrace:
 [1] Cmd(cmd::Cmd; ignorestatus::Bool, env::Tuple{…}, dir::String, cpus::Nothing, detach::Bool, windows_verbatim::Bool, windows_hide::Bool)
   @ Base .\cmd.jl:30
 [2] top-level scope
   @ REPL[20]:1
Some type information was truncated. Use `show(err)` to see complete types.

If the parameters are exclusively integers or exclusively strings then it appears to work ok. I am running Julia 1.10.7.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions