-
Notifications
You must be signed in to change notification settings - Fork 682
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
IPython ignores Control + C after loading Rust module built with PyO3/Maturin #4121
Comments
This may be a bug on the IPython side. Just posting it here in case someone spot something. |
Are you sure this is not an instance of https://pyo3.rs/v0.21.2/faq#ctrl-c-doesnt-do-anything-while-my-rust-code-is-executing? |
@adamreichold, I don't think so. The example I give above does not call Rust functions except when importing the module. I am pretty sure Rust code is not executing in the main thread when the for loop with sleeps are run. |
Bug Description
Posted in ipython/ipython#14417, duplicated below:
I wrote a Rust module
battlesnake_gym
and loaded it into the virtual environment. I ran the script below in IPython and hit Control + C after about 5 seconds, but the script was not interrupted. In fact, IPython now ignores Control + C completely. More information later.However, if I run this script in
python
the default REPL, it gets interrupted by Control + C normally. Therefore, this should have something to do with IPython, not just PyO3/Maturin.Steps to Reproduce
I was trying to provide a minimum reproducible example, but failed with the bare PyO3 examples. Below are the rough steps to reproduce with my codebase, which would be nicer for someone who already have Rye to try out (sorry about the heavy dependencies).
Control C's search keys: control + c, ctrl c, ctrl + c, control c, ctrl c.
Backtrace
No response
Your operating system and version
Debian 6.1.38-2 (2023-07-27) x86_64 GNU/Linux
Your Python version (
python --version
)Python 3.11.8
Your Rust version (
rustc --version
)rustc 1.77.2 (25ef9e3d8 2024-04-09)
Your PyO3 version
0.21.2
How did you install python? Did you use a virtualenv?
I installed Python via Rye. I did use a virtualenv provided by Rye.
Additional Info
No response
The text was updated successfully, but these errors were encountered: