function readprompt(prompt::AbstractString; password::Bool=false)
# TODO DA
if !execute_msg.content["allow_stdin"]
error("IJulia: this front-end does not implement stdin")
end
send_ipython(raw_input[],
msg_reply(execute_msg, "input_request",
Dict("prompt"=>prompt, "password"=>password)))
while true
msg = recv_ipython(raw_input[])
if msg.header["msg_type"] == "input_reply"
return msg.content["value"]
else
error("IJulia error: unknown stdin reply")
end
end
end
I searched for execute_msg across the file and found this function that supposed to assign it the value msg and set it global but the function isn't called anywhere from what I have seen, it also have this comment with it
"""
Jupyter associates cells with message headers. Once a cell's execution state has
been set as to idle, it will silently drop stream messages (i.e. output to
stdout and stderr) - see https://github.com/jupyter/notebook/issues/518.
When using Interact, and a widget's state changes, a new
message header is sent to the IJulia kernel, and while Reactive
is updating Signal graph state, it's execution state is busy, meaning Jupyter
will not drop stream messages if Interact can set the header message under which
the stream messages will be sent. Hence the need for this function.
"""
function set_cur_msg(msg)
global execute_msg = msg
end
so I tried to just comment if !execute_msg.content["allow_stdin"] from readprompt() but then also got hit with UndefVarError: raw_input not defined.
so I guess there is a bug with the way IJulia handles streams or with the readprompt() function, I don't know what to do next.
here is the output for versioninfo()
Julia Version 1.8.5
Commit 17cfb8e65e* (2023-01-08 06:45 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: 8 × Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
Threads: 1 on 8 virtual cores
Environment:
JULIA_NUM_THREADS =
I'm simply trying to read a line using
readline()
but it return this following Stacktrace:I followed it and ended up with this function
I searched for
execute_msg
across the file and found this function that supposed to assign it the valuemsg
and set it global but the function isn't called anywhere from what I have seen, it also have this comment with itso I tried to just comment
if !execute_msg.content["allow_stdin"]
fromreadprompt()
but then also got hit withUndefVarError: raw_input not defined
.so I guess there is a bug with the way IJulia handles streams or with the
readprompt()
function, I don't know what to do next.here is the output for
versioninfo()
I installed Julia from pamac "Offical Repo".
To reproduce the error just type
readline()
.