-
Notifications
You must be signed in to change notification settings - Fork 750
WIP: 449 Py_Initialize_SignalConfiguration #450
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
WIP: 449 Py_Initialize_SignalConfiguration #450
Conversation
@rmadsen-ks, thanks! @vmuriart, @davidanthoff, @yagweb, @filmor and @tonyroberts, please review this. |
Codecov Report
@@ Coverage Diff @@
## master #450 +/- ##
==========================================
- Coverage 77.4% 76.31% -1.09%
==========================================
Files 63 62 -1
Lines 5589 5569 -20
Branches 892 888 -4
==========================================
- Hits 4326 4250 -76
- Misses 970 1026 +56
Partials 293 293
Continue to review full report at Codecov.
|
src/runtime/pythonengine.cs
Outdated
/// </remarks> | ||
public static void Initialize(IEnumerable<string> args, bool setSysArgv = true) | ||
public static void Initialize(IEnumerable<string> args, bool setSysArgv = true, int initSigs = 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initSigs
should be a bool
.
@denfromufa, it seems some of the builds takes an extraordinary amount of time (59 min). Is there some way of canceling the builds so we dont have to wait for timeout? |
@rmadsen-ks you may need to have access to CI build servers to cancel the builds, what do you think @vmuriart ? |
@rmadsen-ks @filmor @vmuriart do you guys agree on removing the test for this behavior and merge pull request without the tests in CI? We can leave the original issue open, until proper testing is added. Here is a user in need of this pull request: |
@denfromufa, unfortunately I dont have the bandwidth to figure how to make a unit test that works reliably. It turned out to be harder than expected to signal CTRL+C to an application running in the console on windows. Also I had decided to use CSharpProvider for runtime assembly generation, which I think is not compatible with .NET core, so that will probably need to move to Roslyn. Do you have another idea of how to test this in an automated way? In any case, the non-test part I think is low risk, but I suggest you do a bit of manual testing first anyway. |
I did not understand the part about CSharpProvider :) But the Ctrl+c keyboard interrupt can be emulated with this threading call:
More details in this new issue that I linked above. |
@denfromufa, This is why I wanted to use CSharpProvider. I wanted to build a short console application that delays for a few s, but is interrupted by a keyboard interrupt. This I could also do by adding an assembly to the git repo, but I figured that would not be a popular decision. In any case, i have not been able to emulate CTRL+C on windows. In my testing running _thread.interrupt_main() (python 3) as the embedded python script does not have the desired effect. |
Let's continue work on this one in #724. |
Note: This PR is not ready yet. I just added the PR to see if it builds.
What does this implement/fix? Explain your changes.
Avoiding overriding signals from the application so that CTRL-C might be handled.
Using Py_InitializeEx(0) (instead Py_Initialize) to avoid overriding signals.
Does this close any currently open issues?
This fixes #449
...
Any other comments?
...
Checklist
Check all those that are applicable and complete.
AUTHORS
CHANGELOG