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

Fixes timeout issues and garbled output issues #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rhythmx
Copy link

@rhythmx rhythmx commented Apr 13, 2022

I've been using this code recently to shoehorn some things into Ghidra by way of Jupyter and have come across a few issues.

  1. The default pexpect.TIMEOUT value causes long-running commands to break the kernel with an exception such as:
[IPKernelApp] ERROR | Exception in message handler:
Traceback (most recent call last):
...
pexpect.exceptions.TIMEOUT: Timeout exceeded.
<pexpect.pty_spawn.spawn object at 0x7f8e787d9a20>
command: /usr/lib/jvm/java-11-openjdk/bin/java
...

This can be resolved by adding a very large timeout or catching the exception and retrying the expect call.

  1. A few issues with matching the Python repl prompts ("..." or ">>>") and terminal control characters can quickly cause the Kernel to become de-synchronized and start inserting garbled result blocks into notebooks. This can be resolved with some extra logic around execution and output matching.

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

Successfully merging this pull request may close these issues.

1 participant