Github messages for voidlinux
 help / color / mirror / Atom feed
From: tornaria <tornaria@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: python3-prompt_toolkit: don't handle sigint
Date: Mon, 28 Feb 2022 02:59:50 +0100	[thread overview]
Message-ID: <20220228015950.yT9uOUglEk62brvpZ-ROe2mNYPlXr-JA_GbiLjl9mrk@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-35730@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1938 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/35730#issuecomment-1053793760

Comment:
>     1. Your original patch to change to change the default SIGINT handling behavior from `True` to `False`, effectively restoring prior behavior and leaving any custom handlers untouched; or

Let's do this, I've force-pushed my original patch. This is completely acceptable for sagemath.


> Option 1 may cause IPython to crash when it receives SIGINT, but that is functionally no worse than a revert to a prior version of `prompt_toolkit` and I can live with it.

I can live with this too. I hadn't even noticed this before I looked at the xonsh bug report.

> [...] 

>having `prompt_toolkit` take special branches in every iteration of the event loop on the off chance that an arbitrary package is installed does not seem to be the right approach and certainly doesn't cover these alternatives.

Just for the record, assuming I understand the way python imports work, my patch doesn't add branches in the event loop.  It tries to import cysignals.pysignals ONCE when prompt_toolkit is imported for the first time. If that fails, it will import instead alternative pure python functions (not using cysignals / not preserving the os-level sigint handler).  These functions are unconditionally called once when prompt starts (to save the sigint handler) and once when the prompt finishes (to restore the sigint handler). The event loop runs all the prompt editing, completion, etc, etc, but this will not mess with signals at all.


> If you do PR your optional approach upstream, you should probably define a package option to declare the dependency so that the package can advertise the possibility.

I'll wait for comments first before doing a PR. I might ask you for help then, since my understanding of python packaging and hard vs optional dependencies is almost nil.


  parent reply	other threads:[~2022-02-28  1:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21 14:03 [PR PATCH] " tornaria
2022-02-21 14:11 ` ahesford
2022-02-21 14:11 ` ahesford
2022-02-21 14:35 ` tornaria
2022-02-24 20:59 ` [PR PATCH] [Updated] " tornaria
2022-02-24 21:01 ` tornaria
2022-02-25 15:53 ` ahesford
2022-02-25 21:46 ` tornaria
2022-02-25 22:11 ` ahesford
2022-02-27 18:19 ` tornaria
2022-02-27 21:48 ` ahesford
2022-02-27 21:49 ` ahesford
2022-02-27 21:49 ` ahesford
2022-02-28  1:35 ` [PR PATCH] [Updated] " tornaria
2022-02-28  1:59 ` tornaria [this message]
2022-02-28  2:25 ` [PR PATCH] [Merged]: " ahesford
2022-02-28  2:28 ` ahesford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220228015950.yT9uOUglEk62brvpZ-ROe2mNYPlXr-JA_GbiLjl9mrk@z \
    --to=tornaria@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).