Debugger terminates session with SIGKILL (code 139) instead of SIGTERM

When terminating a debug session, is it possible to terminate session with SIGTERM instead of SIGKILL? Being unable to catch SIGKILL is causing trouble, as our app is unable to close certain resources.
Is there a work around for this, or perhaps a better way?

Thank you,
Comment actions Permalink
Before posting please check if your problem hadn't been already posted here or in the issue tracker.
Searching this forum for the word "sigterm" ( brings this result –
Searching issue tracker for the word "sigterm" ( brings this result –

As you can see, there was not much activity in bug PY-13316. You can vote for fixing this bug.
Comment actions Permalink
Thank you for your reply Piotr.

Apparently my searching skills need work, as I somehow initially missed the posts you referred to.
I will most certainly be voting to fix that "bug". (I wouldn't have considered it a bug, probably more of a questionable design decision.)

While this is very helpful information, any known work-around would be welcome.
Comment actions Permalink
Well, you can always send signal using kill (by PID) or pkill (by name) program. You could somehow streamline this by creating "external" tool (File|Settings|Tools|External Tools) which allows for quick access from within PyCharm later ('Tools|External Tools' from main menu or 'External Tools' entry from context menu).

Please sign in to leave a comment.