Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPython mode (or Numbered prompt) does not accept an input only with comment #49319

Closed
hyrodium opened this issue Apr 11, 2023 · 2 comments · Fixed by #50064
Closed

IPython mode (or Numbered prompt) does not accept an input only with comment #49319

hyrodium opened this issue Apr 11, 2023 · 2 comments · Fixed by #50064
Labels
kind:bug Indicates an unexpected problem or unintended behavior stdlib:REPL Julia's REPL (Read Eval Print Loop)

Comments

@hyrodium
Copy link
Sponsor Contributor

MRE:

In [1]: versioninfo()
Julia Version 1.9.0-rc2
Commit 72aec423c2a (2023-04-01 10:41 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD Ryzen 7 2700X Eight-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, znver1)
  Threads: 1 on 16 virtual cores

In [2]: nothing  # ok

In [3]: # ng
ERROR: type Nothing has no field args
Stacktrace:
  [1] getproperty(x::Nothing, f::Symbol)
    @ Base ./Base.jl:37
  [2] get_usings!(usings::Vector{Any}, ex::Nothing)
    @ REPL.IPython ~/julia/julia-1.9.0-rc2/share/julia/stdlib/v1.9/REPL/src/REPL.jl:1423
  [3] out_transform(x::Any, n::Base.RefValue{Int64})
    @ REPL.IPython ~/julia/julia-1.9.0-rc2/share/julia/stdlib/v1.9/REPL/src/REPL.jl:1413
  [4] (::REPL.IPython.var"#5#6"{Base.RefValue{Int64}})(ast::Any)
    @ REPL.IPython ~/julia/julia-1.9.0-rc2/share/julia/stdlib/v1.9/REPL/src/REPL.jl:1476
  [5] #invokelatest#2
    @ ./essentials.jl:816 [inlined]
  [6] invokelatest
    @ ./essentials.jl:813 [inlined]
  [7] eval_user_input(ast::Any, backend::REPL.REPLBackend, mod::Module)
    @ REPL ~/julia/julia-1.9.0-rc2/share/julia/stdlib/v1.9/REPL/src/REPL.jl:151
  [8] repl_backend_loop(backend::REPL.REPLBackend, get_module::Function)
    @ REPL ~/julia/julia-1.9.0-rc2/share/julia/stdlib/v1.9/REPL/src/REPL.jl:249
  [9] start_repl_backend(backend::REPL.REPLBackend, consumer::Any; get_module::Function)
    @ REPL ~/julia/julia-1.9.0-rc2/share/julia/stdlib/v1.9/REPL/src/REPL.jl:234
 [10] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool, backend::Any)
    @ REPL ~/julia/julia-1.9.0-rc2/share/julia/stdlib/v1.9/REPL/src/REPL.jl:377
 [11] run_repl(repl::REPL.AbstractREPL, consumer::Any)
    @ REPL ~/julia/julia-1.9.0-rc2/share/julia/stdlib/v1.9/REPL/src/REPL.jl:363
 [12] (::Base.var"#1019#1021"{Bool, Bool, Bool})(REPL::Module)
    @ Base ./client.jl:421
 [13] #invokelatest#2
    @ ./essentials.jl:816 [inlined]
 [14] invokelatest
    @ ./essentials.jl:813 [inlined]
 [15] run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)
    @ Base ./client.jl:405
 [16] exec_options(opts::Base.JLOptions)
    @ Base ./client.jl:322
 [17] _start()
    @ Base ./client.jl:522
@PhyX-Meow
Copy link

PhyX-Meow commented Apr 12, 2023

It's OK for me

In [2]: versioninfo()
Julia Version 1.9.0-rc2
Commit 72aec423c2a (2023-04-01 10:41 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD Ryzen 7 3700X 8-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, znver2)
  Threads: 1 on 16 virtual cores
Environment:
  LD_LIBRARY_PATH = .:../lib:./lib
  JULIA_PKG_SERVER = https://mirrors.tuna.tsinghua.edu.cn/julia

In [3]: nothing

In [4]: # ng

In [5]: 1+1
Out[5]: 2

What's your startup.jl? Here is mine:

import REPL
using Revise
using OhMyREPL
#  colorscheme!("GruvboxDark")
atreplinit() do repl
    if !isdefined(repl, :interface)
        repl.interface = REPL.setup_interface(repl)
    end
    REPL.ipython_mode!(repl)
end

@hyrodium
Copy link
Sponsor Contributor Author

Here's my startup.jl:

import REPL
atreplinit() do repl
    if !isdefined(repl, :interface)
        repl.interface = REPL.setup_interface(repl)
    end
    REPL.ipython_mode!(repl)
end

It seems the key difference is using OhMyREPL. By adding the line, the error was not reproduced.

@JeffBezanson JeffBezanson added kind:bug Indicates an unexpected problem or unintended behavior stdlib:REPL Julia's REPL (Read Eval Print Loop) labels Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Indicates an unexpected problem or unintended behavior stdlib:REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants