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

Running a cell which has Bash code with a missing delimiter causes ValueError: Continuation prompt found - input was incomplete: in Jupyter log #118

Open
ackalker opened this issue Feb 9, 2022 · 1 comment

Comments

@ackalker
Copy link

ackalker commented Feb 9, 2022

2022-02-09-112302_1920x1080_scrot

Running a cell with some missing delimiter (see screenshot above) produces the following error output in my Jupyter log, and requires interrupting the kernel to be able to continue working:

[I 2022-02-09 11:08:39.046 ServerApp] Creating new notebook in /Documents/JupyterLab
[I 2022-02-09 11:08:39.582 ServerApp] Kernel started: a8654c4f-a53d-49f5-a022-e71746be6b85
[IPKernelApp] ERROR | Exception in message handler:
Traceback (most recent call last):
  File "/home/miki/.pyenv/versions/jupyterlab/lib/python3.10/site-packages/ipykernel/kernelbase.py", line 357, in dispatch_shell
    await result
  File "/home/miki/.pyenv/versions/jupyterlab/lib/python3.10/site-packages/ipykernel/kernelbase.py", line 647, in execute_request
    reply_content = self.do_execute(
  File "/home/miki/.pyenv/versions/jupyterlab/lib/python3.10/site-packages/bash_kernel/kernel.py", line 143, in do_execute
    self.bashwrapper.run_command(code.rstrip(), timeout=None)
  File "/home/miki/.pyenv/versions/jupyterlab/lib/python3.10/site-packages/pexpect/replwrap.py", line 107, in run_command
    raise ValueError("Continuation prompt found - input was incomplete:\n"
ValueError: Continuation prompt found - input was incomplete:
echo "This string is missing a closing quote
[I 2022-02-09 11:10:40.393 ServerApp] Saving file at /Documents/JupyterLab/valueerror_continuation_prompt_found.ipynb

Missing a closing quote, parenthesis or fi, esac or done is a quite common occurrence when writing shell commands. It would be nice if bash_kernel would report the error in the cell output instead of in the Jupyter log.

@ackalker ackalker changed the title ValueError: Continuation prompt found - input was incomplete: when cell has Bash code with a missing delimiter Running a cell which has Bash code with a missing delimiter causes ValueError: Continuation prompt found - input was incomplete: in Jupyter log Feb 9, 2022
@takluyver
Copy link
Owner

Yes, it should probably catch that ValueError and send it to the user as an error message. PRs welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants