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

Chaining exceptions at C level #65914

Closed
serhiy-storchaka opened this issue Jun 11, 2014 · 6 comments
Closed

Chaining exceptions at C level #65914

serhiy-storchaka opened this issue Jun 11, 2014 · 6 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 21715
Nosy @pitrou, @benjaminp, @serhiy-storchaka
Files
  • capi_chain_exceptions.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 = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2014-10-08.20:01:30.273>
    created_at = <Date 2014-06-11.06:15:47.182>
    labels = ['interpreter-core', 'type-feature']
    title = 'Chaining exceptions at C level'
    updated_at = <Date 2014-10-08.20:01:30.271>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2014-10-08.20:01:30.271>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2014-10-08.20:01:30.273>
    closer = 'serhiy.storchaka'
    components = ['Interpreter Core']
    creation = <Date 2014-06-11.06:15:47.182>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['35857']
    hgrepos = []
    issue_num = 21715
    keywords = ['patch']
    message_count = 6.0
    messages = ['220236', '221918', '222296', '222339', '228813', '228815']
    nosy_count = 5.0
    nosy_names = ['pitrou', 'benjamin.peterson', 'stutzbach', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue21715'
    versions = ['Python 3.4', 'Python 3.5']

    @serhiy-storchaka
    Copy link
    Member Author

    The proposed patch introduces new private function which chains previously fetched and current exceptions. This will help in correct implementing at C level an equivalent of following Python idioms:

    try:
        ...
    finally:
        ...
    

    and

    try:
        ...
    except:
        ...
        raise
    

    @serhiy-storchaka serhiy-storchaka added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels Jun 11, 2014
    @pitrou
    Copy link
    Member

    pitrou commented Jun 29, 2014

    Hm, looks like you forgot to upload a patch!

    @serhiy-storchaka
    Copy link
    Member Author

    Sorry. Here is it.

    @serhiy-storchaka
    Copy link
    Member Author

    I added 3.4 because this private function makes cleaner and more bug-free existing code (mostly recently added) and possible future bug fixes. Note a bug just fixed by Benjamin (changeset 888fd1cdec6f).

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 8, 2014

    New changeset 9af21752ea2a by Serhiy Storchaka in branch '3.4':
    Issue bpo-21715: Extracted shared complicated code in the _io module to new
    https://hg.python.org/cpython/rev/9af21752ea2a

    New changeset 8b1ac1a3d007 by Serhiy Storchaka in branch 'default':
    Issue bpo-21715: Extracted shared complicated code in the _io module to new
    https://hg.python.org/cpython/rev/8b1ac1a3d007

    @serhiy-storchaka
    Copy link
    Member Author

    Thank you for the review Antoine.

    @serhiy-storchaka serhiy-storchaka self-assigned this Oct 8, 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
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants