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
|
FYI I spent an enormous amount of time trying to get synthetic control-C to work reliably for tests in Trio, with What I eventually realized is: normally, when a So if you want to simulate this for testing, you can do that by starting a new thread and using it to call There is one caveat, which is that if you have code that uses |
|
@njsmith what do you suggest? |
|
I'm not sure :-(. The frustrating thing is that I never did figure out why I was getting such weird effects or how to avoid them. So... it's possible this patch is somehow using exactly the right incantation and will work perfectly for everyone forever? It's promising that both Appveyor and Azure are green – when I tried I could get it working reliably locally but never on Appveyor, so this is already doing better than that. So it's a judgement call... merging as is has some risk, or it might be fine. Rewriting should definitely be fine, but obviously requires more work. |
|
Interesting, I've initially considered using Script above works correctly with debug version of Python and fails with release. To make it work with a release flavor (and break debug) - commend loading of debug CRT and uncomment a line that loads release C runtime. NOTE: per this discussion loading named exports from I've tried |
Console control events are implemented mainly in user mode from start to finish, but the kernel is of course involved with interprocess messaging and thread creation. In particular, the console host (conhost.exe) sends an LPC message to the session server (csrss.exe) to request the creation of a control thread. This thread executes the undocumented WinAPI
|
|
Oh, that's interesting... right now Trio unconditionally uses
@zooba at least argues for using a low bar to add things to Filed a bug for that: https://bugs.python.org/issue35568 |
There's no capability in the loaders's API-set schema to dynamically map this name to "ucrtbased.dll". In a release build, prefer the API set. In a debug build, use "ucrtbased.dll". (Notice that the PE import tables for debug builds link with ucrtbased.dll instead of to the CRT API sets.) For cross-platform code, use |
|
@eryksun I suspect you're right that that's the best option currently available, but is there really a hard rule that |
|
looks like |
…ng unregistration that was also fixed.
|
is there anything else that should be done in this PR? |
|
Another way to raise Note that the original code that this PR replaces is relying on buggy behavior. It uses |
IIRC when I looked at this I decided that |
|
I'm willing to merge this, but I'm not clear why it's been held up? Is anyone else in this discussion planning to merge or are you just chatting now? If it's just chat, better to go on the bug rather than here, since this will all be lost once it's merged. |
|
is there anything else that should be done for this PR? |
|
I think everything is fine. |
|
@asvetlov: Please replace |
Switch from using
CREATE_NEW_CONSOLEtoCREATE_NEW_PROCESS_GROUPin tests forProactorEventLoopthat use ctrl-c. Addresses issue reported in #11135.https://bugs.python.org/issue23057