Skip to content
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

Expose valid signal set (sigfillset()): add signal.valid_signals() #77513

Closed
pitrou opened this issue Apr 22, 2018 · 7 comments
Closed

Expose valid signal set (sigfillset()): add signal.valid_signals() #77513

pitrou opened this issue Apr 22, 2018 · 7 comments
Labels
3.8 (EOL) end of life type-feature A feature request or enhancement

Comments

@pitrou
Copy link
Member

pitrou commented Apr 22, 2018

BPO 33332
Nosy @pitrou, @vstinner, @njsmith, @csabella
PRs
  • bpo-33332: Add signal.valid_signals() #6581
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2018-05-04.11:01:34.363>
    created_at = <Date 2018-04-22.11:03:27.620>
    labels = ['type-feature', '3.8']
    title = 'Expose valid signal set (sigfillset()): add signal.valid_signals()'
    updated_at = <Date 2018-05-04.13:29:30.265>
    user = 'https://github.com/pitrou'

    bugs.python.org fields:

    activity = <Date 2018-05-04.13:29:30.265>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-05-04.11:01:34.363>
    closer = 'pitrou'
    components = []
    creation = <Date 2018-04-22.11:03:27.620>
    creator = 'pitrou'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 33332
    keywords = ['patch']
    message_count = 7.0
    messages = ['315606', '316165', '316166', '316171', '316172', '316173', '316174']
    nosy_count = 4.0
    nosy_names = ['pitrou', 'vstinner', 'njs', 'cheryl.sabella']
    pr_nums = ['6581']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue33332'
    versions = ['Python 3.8']

    @pitrou
    Copy link
    Member Author

    pitrou commented Apr 22, 2018

    See bpo-33329: it would be nice to expose a signal module function to get the set of user-actionable signals. Hopefully sigfillset() does that.

    @pitrou pitrou added 3.8 (EOL) end of life type-feature A feature request or enhancement labels Apr 22, 2018
    @vstinner vstinner changed the title Expose valid signal set (sigfillset()) Expose valid signal set (sigfillset()): add signal.valid_signals() May 3, 2018
    @pitrou
    Copy link
    Member Author

    pitrou commented May 4, 2018

    New changeset 9d3627e by Antoine Pitrou in branch 'master':
    bpo-33332: Add signal.valid_signals() (GH-6581)
    9d3627e

    @pitrou pitrou closed this as completed May 4, 2018
    @vstinner
    Copy link
    Member

    vstinner commented May 4, 2018

    FYI on Fedora 27, I get:

    >>> signal.NSIG
    65
    >>> set(range(0, signal.NSIG)) - signal.valid_signals()
    {0, 33, 32}
    >>> len(signal.valid_signals())
    62
    >>> min(signal.valid_signals())
    <Signals.SIGHUP: 1>
    >>> max(signal.valid_signals())
    <Signals.SIGRTMAX: 64>

    So signals 0, 32 and 33 are invalid, the first valid signal is 1 and the last is 64.

    @csabella
    Copy link
    Contributor

    csabella commented May 4, 2018

    On Ubuntu 14.04, I get the same results as Victor.

    @pitrou
    Copy link
    Member Author

    pitrou commented May 4, 2018

    This is expected, see bpo-33329.

    @vstinner
    Copy link
    Member

    vstinner commented May 4, 2018

    + if (sigemptyset(&mask) || sigfillset(&mask)) {

    I'm not sure that sigemptyset() is needed.

    sigfillset() manual page:

       sigfillset() initializes set to full, including all signals.
    

    The function is used to *initialize* a set.

    @pitrou
    Copy link
    Member Author

    pitrou commented May 4, 2018

    Yes, but we're not losing anything by being overly cautious.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 (EOL) end of life type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants