You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python 3.6.3 (default, Oct 4 2017, 06:09:05)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.0.0 -- An enhanced Interactive Python. Type '?' for help.
On linux with ipython 5.1.0, I am able to do tab completion of methods of the Julia object, but when I try to complete filenames in a string, it segfaults, e.g.
In [1]: import julia
In [2]: j = julia.Julia()
In [3]: j.evalfile("new<tab>
signal (11): Segmentation fault
while loading no file, in expression starting on line 0
Segmentation fault
As @takluyver guessed in ipython/ipython#10899 (comment), it looks like threading problem. Just in case if someone wants to reproduce the problem in a script, here it is:
importthreadingfromIPython.testing.globalipappimportget_ipythonfromjuliaimportJuliaip=get_ipython()
ip.user_ns['julia'] =Julia()
defip_complete():
print(ip.complete('julia.sin.'))
print("ip_complete() in main thread:")
ip_complete()
print()
print("ip_complete() in different thread:")
th=threading.Thread(target=ip_complete)
th.start()
th.join()
It prints
ip_complete() in main thread:
('julia.sin.', ['julia.sin.jl_value'])
ip_complete() in different thread:
signal (11): Segmentation fault
When prompt_toolkit version 2 is ready, we (IPython) should be able to do completions in the main thread, which should avoid this kind of issue. A few things have come up that don't like their completions running from another thread.
I just found out that IPython master (to be released as 7.0) already was upgraded to use prompt_toolkit 2.0! ipython/ipython#11177 I have to try it soon...
Activity
simonbyrne commentedon Nov 14, 2017
Interestingly, it's fine in the normal python3 shell. So maybe it's an IPython issue?
stevengj commentedon Nov 14, 2017
IPython does tab completion differently than python3, but it's probably ultimately a pyjulia bug that is being triggered.
zsunberg commentedon Nov 28, 2017
On linux with ipython 5.1.0, I am able to do tab completion of methods of the Julia object, but when I try to complete filenames in a string, it segfaults, e.g.
tkf commentedon May 13, 2018
As @takluyver guessed in ipython/ipython#10899 (comment), it looks like threading problem. Just in case if someone wants to reproduce the problem in a script, here it is:
It prints
I wonder if PyCall/libjulia can support multi-thread usage. JuliaLang/julia#17573
tkf commentedon May 13, 2018
Of course, producing segfault this way doesn't require IPython:
takluyver commentedon May 20, 2018
When prompt_toolkit version 2 is ready, we (IPython) should be able to do completions in the main thread, which should avoid this kind of issue. A few things have come up that don't like their completions running from another thread.
tkf commentedon May 20, 2018
@takluyver Thanks. That would be awesome.
tkf commentedon Jul 31, 2018
I just found out that IPython master (to be released as 7.0) already was upgraded to use prompt_toolkit 2.0! ipython/ipython#11177 I have to try it soon...
FYI, here is IPython's 7.0 milestone https://github.com/ipython/ipython/milestone/43
tkf commentedon Jul 31, 2018
Yes, tab completion in IPython master works with pyjulia!
tkf commentedon Oct 20, 2018
IPython 7.0 is already released and available in PyPI and Anaconda. Closing...