-
Notifications
You must be signed in to change notification settings - Fork 8
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
Python REPL: KeyboardInterrupt stops working after import #74
Comments
Weird. I could only reproduce this on the first try. The only place I see
|
@johnnychen94
My envrionment:
|
I assume you're saying it's a wget issue? In [1]: import wget
In [2]: wget.download("https://hi")
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C
KeyboardInterrupt This Python package isn't maintained since 2015, so maybe this issue is a good reason to drop wget-python in jill. |
Other task also fail to use KeyboardInterrupt too, so maybe something of jnumpy breaks the signal handling |
Register a signal handler may solve this problem, but I could not find where jnumpy breaks this yet, and not sure if other signal handler works fine. @thautwarm could you have a look? import time
import signal
default_sigint_handler = signal.getsignal(signal.SIGINT)
print(default_sigint_handler) # <built-in function default_int_handler>
import jnumpy as jnp
jnp.init_jl()
print(signal.getsignal(signal.SIGINT)) # still <built-in function default_int_handler> ???
signal.signal(signal.SIGINT, default_sigint_handler) # if we don't call this, the Ctrl-C would not work below
# Ctrl-C works here
for i in range(10):
print(i)
time.sleep(1) ps: it's weird. the code above works fine in my archlinux system, but fails in my win10 system :( |
We need to disable the signal handle of julia in python mode: SessionCtx.JULIA_START_OPTIONS = ["--handle-signals=no", jl_opts_proj, *jl_opts] This solves the problem. |
As described in the title, KeyboardInterrupt stops working after importing the
basic
example of this repo.How to reproduce:
Using the
Dockerfile
below run:$ docker build -t jnumpy . $ docker run -it jnumpy python
and then
Dockerfile:
The text was updated successfully, but these errors were encountered: