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

selectors should use bare except clauses #74809

Closed
giampaolo opened this issue Jun 10, 2017 · 8 comments
Closed

selectors should use bare except clauses #74809

giampaolo opened this issue Jun 10, 2017 · 8 comments
Labels

Comments

@giampaolo
Copy link
Contributor

BPO 30624
Nosy @gvanrossum, @vstinner, @giampaolo, @berkerpeksag, @serhiy-storchaka, @1st1, @Mariatta
PRs
  • bpo-30624 / selectors: use bare except clause #2082
  • bpo-30624 remaining bare except #2108
  • 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 2017-06-12.12:52:28.737>
    created_at = <Date 2017-06-10.18:11:44.214>
    labels = ['3.7', 'expert-asyncio']
    title = 'selectors should use bare except clauses'
    updated_at = <Date 2017-06-12.12:52:28.734>
    user = 'https://github.com/giampaolo'

    bugs.python.org fields:

    activity = <Date 2017-06-12.12:52:28.734>
    actor = 'giampaolo.rodola'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-06-12.12:52:28.737>
    closer = 'giampaolo.rodola'
    components = ['asyncio']
    creation = <Date 2017-06-10.18:11:44.214>
    creator = 'giampaolo.rodola'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30624
    keywords = []
    message_count = 8.0
    messages = ['295648', '295682', '295685', '295699', '295701', '295706', '295772', '295773']
    nosy_count = 8.0
    nosy_names = ['gvanrossum', 'vstinner', 'giampaolo.rodola', 'neologix', 'berker.peksag', 'serhiy.storchaka', 'yselivanov', 'Mariatta']
    pr_nums = ['2082', '2108']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue30624'
    versions = ['Python 3.7']

    @giampaolo
    Copy link
    Contributor Author

    Right now it uses "except Exception: ...; raise" which does not take KeyboardInterrupt and SystemExit into account, leaving the fd in a bad state (it's not unregister()ed).

    @Mariatta
    Copy link
    Member

    I removed 3.4 from versions, since this is not a security fix.

    Does this need backport to 3.5 too?
    Or only 3.6?

    @serhiy-storchaka
    Copy link
    Member

    Look also at KqueueSelector.modify(). And the mentioning of SystemError in Misc/NEWS is wrong, it is a subclass of Exception.

    @vstinner
    Copy link
    Member

    Serhiy Storchaka added the comment:

    Look also at KqueueSelector.modify(). And the mentioning of SystemError in
    Misc/NEWS is wrong, it is a subclass of Exception.

    I guess that he means SystemExit ;-)

    @serhiy-storchaka
    Copy link
    Member

    My apologies. The Misc/NEWS entry is correct. But only 2 of 3 "except Exception" are fixed.

    @giampaolo
    Copy link
    Contributor Author

    But only 2 of 3 "except Exception" are fixed.

    My bad. New PR:
    #2108

    @giampaolo
    Copy link
    Contributor Author

    New changeset ced36a9 by Giampaolo Rodola in branch 'master':
    bpo-30624 remaining bare except (bpo-2108)
    ced36a9

    @giampaolo
    Copy link
    Contributor Author

    I see that on 3.6 except BaseException: is used, so the backport should not be necessary.

    @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
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants