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

Fix silencing all errors if an attribute lookup fails #82175

Closed
serhiy-storchaka opened this issue Aug 31, 2019 · 4 comments
Closed

Fix silencing all errors if an attribute lookup fails #82175

serhiy-storchaka opened this issue Aug 31, 2019 · 4 comments
Labels
3.8 only security fixes 3.9 only security fixes extension-modules C modules in the Modules dir interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 37994
Nosy @serhiy-storchaka
PRs
  • bpo-37994: Fix silencing all errors if an attribute lookup fails. #15630
  • [3.8] bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630) #15635
  • 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 2019-09-01.11:01:29.198>
    created_at = <Date 2019-08-31.08:10:28.983>
    labels = ['extension-modules', 'interpreter-core', 'type-bug', '3.8', '3.9']
    title = 'Fix silencing all errors if an attribute lookup fails'
    updated_at = <Date 2019-09-01.11:01:29.197>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2019-09-01.11:01:29.197>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-09-01.11:01:29.198>
    closer = 'serhiy.storchaka'
    components = ['Extension Modules', 'Interpreter Core']
    creation = <Date 2019-08-31.08:10:28.983>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37994
    keywords = ['patch']
    message_count = 4.0
    messages = ['350911', '350912', '350939', '350945']
    nosy_count = 1.0
    nosy_names = ['serhiy.storchaka']
    pr_nums = ['15630', '15635']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue37994'
    versions = ['Python 3.8', 'Python 3.9']

    @serhiy-storchaka
    Copy link
    Member Author

    There are still sites in the CPython code where all errors of failed attribute lookup are silenced or overridden by other exception. This can hide such exceptions like MemoryError, RecursionError or KeyboardInterrupt and lead to incorrect result (as the attribute was just absent instead of looking it up was interrapted by side causes). Only AttributeError is expected to signal an absence of an attribute, and only it can be silenced.

    The proposed PR fixes most of such cases.

    There are still few sites where *all* errors are ignored (for example when report an error to the stderr or like), they should be considered separately.

    @serhiy-storchaka serhiy-storchaka added 3.8 only security fixes 3.9 only security fixes extension-modules C modules in the Modules dir interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Aug 31, 2019
    @serhiy-storchaka
    Copy link
    Member Author

    Previous round of fixing such issues is bpo-32571.

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 41c57b3 by Serhiy Storchaka in branch 'master':
    bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630)
    41c57b3

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 353053d by Serhiy Storchaka in branch '3.8':
    [3.8] bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630) (GH-15635)
    353053d

    @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 only security fixes 3.9 only security fixes extension-modules C modules in the Modules dir interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant