-
-
Notifications
You must be signed in to change notification settings - Fork 150
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
CTRL-C always results in an error #139
Comments
Nox doesn't pass the signal to the subprocess, it just kills it outright. Maybe we should fix that. |
FWIW, I have a session that might be affected by this: @nox.session
def run(session):
session.install("pelican")
cmd = [
"python",
"-m",
"http.server",
str(CONFIGURATION["dev_port"]),
"-d",
CONFIGURATION["output_path"],
]
# NOTE: A bare Popen() results in a child being spawned.
# As of nox 2018.10.17, this child gets killed when the process ends.
session.log(" ".join(cmd) + " (background)")
subprocess.Popen(cmd)
# -r means this process rebuilds until it receives a ^C or gets killed.
session.run("pelican", "-r", "-d", "-s", CONFIGURATION["dev"], "src") TBH, this is more of a generic automation thing that I'm using nox for than just testing but I think it's pretty awesome that nox is flexible enough to be able to do this. :) |
Just adding another use case here... This behavior also appears to break |
This could resolved by modifying this code to pass an interrupt signal to the child process instead of just killing it outright. We should, however, make sure to have some reasonable timeout and kill the child process if it hangs. |
If
nox -s foo
encounters aKeyboardInterrupt
but the currently running script catches it and handles it gracefully,nox
will still report a failure. For example:However, if the same application runs outside of
nox
there is no error (i.e.flask
exits gracefully):What should the correct
nox
behavior be here?The text was updated successfully, but these errors were encountered: