Skip to content

:io.get_line returns binary in Elixir and charlist in Erlang #14757

@mneumann

Description

@mneumann

Elixir and Erlang/OTP versions

~ % elixir --version
Erlang/OTP 28 [erts-16.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.18.4 (compiled with Erlang/OTP 28)
~ % erl --version
Erlang/OTP 28 [erts-16.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Eshell V16.0.2 (press Ctrl+G to abort, type help(). for help)

Operating system

DragonFlyBSD

Current behavior

In Erlang (from erl):

is_binary(io:get_line("")). #=> false

In Elixir (from iex):

is_binary(:io:get_line("")) #=> true

Very strange. I tried to call :snmp.config() from iex, and it failed because of that, while it works perfectly in erl.

Expected behavior

I would expect that calling :io.get_line to return the same data-type regardless of whether it is being called from Erlang or Elixir. Any Erlang code that uses :io.get_line and is run from Elixir would fail.

Metadata

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