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

assert that functions clearing the current exception are not called with an exception set #66056

Closed
vstinner opened this issue Jun 24, 2014 · 3 comments

Comments

@vstinner
Copy link
Member

BPO 21857
Nosy @vstinner
Files
  • assert_exc.patch
  • 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 2014-07-01.15:17:36.628>
    created_at = <Date 2014-06-24.09:49:31.099>
    labels = ['invalid']
    title = 'assert that functions clearing the current exception are not called with an exception set'
    updated_at = <Date 2014-07-01.15:17:36.627>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2014-07-01.15:17:36.627>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-07-01.15:17:36.628>
    closer = 'vstinner'
    components = []
    creation = <Date 2014-06-24.09:49:31.099>
    creator = 'vstinner'
    dependencies = []
    files = ['35767']
    hgrepos = []
    issue_num = 21857
    keywords = ['patch']
    message_count = 3.0
    messages = ['221444', '221446', '222046']
    nosy_count = 1.0
    nosy_names = ['vstinner']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue21857'
    versions = ['Python 3.5']

    @vstinner
    Copy link
    Member Author

    Attached patch detects (when Python is compiled in debug mode) if functions that may clear the current exception are called with an exception set.

    The check avoids loosing an exception.

    The problem is that the test_sqlite fails with the patch applied. I will open a new patch for that.

    I already added similar checks in functions of Python/ceval.c.

    @vstinner
    Copy link
    Member Author

    The problem is that the test_sqlite fails with the patch applied. I will open a new patch for that.

    I opened the issue bpo-21858 for that.

    @vstinner
    Copy link
    Member Author

    vstinner commented Jul 1, 2014

    I don't think anymore that it's a good idea. Almost all C functions can replace the current Python exception. There is no reason to add assertions only in a few functions.

    @vstinner vstinner closed this as completed Jul 1, 2014
    @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
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant