-
Notifications
You must be signed in to change notification settings - Fork 778
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
Try fix CI #2314
Try fix CI #2314
Conversation
It also prints Edit: Seems like it has been doing this since |
This reproduces the error: use pyo3::prelude::*;
const SOURCE: &str = r#"
import asyncio
import sys
async def main():
pass
# For an odd error similar to https://bugs.python.org/issue38563
if sys.platform == "win32" and sys.version_info >= (3, 8, 0):
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
asyncio.run(main())
"#;
fn main() {
Python::with_gil(|_| {});
let handle = std::thread::spawn(|| {
Python::with_gil(|py| {
py.run(SOURCE, None, None).map_err(|e| e.print(py)).unwrap();
});
});
handle.join().unwrap();
}
|
😬 I guess we should pin to alpha-6 for now? |
To unblock other PRs, I think it makes sense to do so. |
Yep agreed. Thanks for investigating! |
I'm curious -- the PR (python/cpython#32105) has an explicit check whether it's running in the main thread: if (threading.current_thread() is threading.main_thread()
and signal.getsignal(signal.SIGINT) is signal.default_int_handler
):
sigint_handler = functools.partial(self._on_sigint, main_task=task)
signal.signal(signal.SIGINT, sigint_handler) Is there something unusual in your code that makes the first line of that check pass? Are you using subinterpreters? |
@davidhewitt answered in some detail on the Python issue thread, let's continue the discussion there. |
For completeness, I think the See also #2319 (comment) where I comment a little on how we call Aside, it would be cool if we were using sub-interpreters, however that's still miles off because it's a huge research question how we need to change the PyO3 public API to allow us to implement PEP 489 compatibility. |
The Python 3.11 runner keeps failing:
I have reproduced this locally, using the
3.11.0-alpha.7
interpreter.It does not happen if either:
3.11.0-alpha.6
is used.cargo test --test test_proto_methods --features=full -- --test-threads 1