Skip to content

Make sure exceptions raised in __aiter__ are properly chained in ceval #73079

Description

@1st1
BPO 28893
Nosy @brettcannon, @vstinner, @ned-deily, @serhiy-storchaka, @1st1
PRs
  • bpo-28893: Set __cause__ for errors in async iteration protocol #407
  • bpo-28893: Set __cause__ for errors in async iteration protocol #414
  • [Do Not Merge] Sample of CPython life with blurb. #703
  • [Do Not Merge] Convert Misc/NEWS so that it is managed by towncrier #552
  • Files
  • chain.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/1st1'
    closed_at = <Date 2017-03-03.23:10:38.759>
    created_at = <Date 2016-12-07.04:41:33.466>
    labels = ['interpreter-core', 'type-bug', '3.7']
    title = 'Make sure exceptions raised in __aiter__ are properly chained in ceval'
    updated_at = <Date 2017-03-31.16:36:30.278>
    user = 'https://github.com/1st1'

    bugs.python.org fields:

    activity = <Date 2017-03-31.16:36:30.278>
    actor = 'dstufft'
    assignee = 'yselivanov'
    closed = True
    closed_date = <Date 2017-03-03.23:10:38.759>
    closer = 'yselivanov'
    components = ['Interpreter Core']
    creation = <Date 2016-12-07.04:41:33.466>
    creator = 'yselivanov'
    dependencies = []
    files = ['45782']
    hgrepos = []
    issue_num = 28893
    keywords = ['patch']
    message_count = 6.0
    messages = ['282595', '282597', '282659', '282675', '288853', '290339']
    nosy_count = 5.0
    nosy_names = ['brett.cannon', 'vstinner', 'ned.deily', 'serhiy.storchaka', 'yselivanov']
    pr_nums = ['407', '414', '703', '552']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue28893'
    versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

    Activity

    1. 1st1 commented on Dec 7, 2016

      @1st1
      MemberAuthor

      Originally reported in http://bugs.python.org/issue28885#msg282538

      Ned, please take a look at the attached patch. While I think that the change is quite small & safe to merge, I think it's OK if we push this only in 3.6.1. It's a nice usability improvement, but only for people that implement objects with custom __await__, which is quite a rare case.

    2. self-assigned this
      on Dec 7, 2016
    3. added
      interpreter-core(Objects, Python, Grammar, and Parser dirs)
      type-bugAn unexpected behavior, bug, or error
      on Dec 7, 2016
    4. serhiy-storchaka commented on Dec 7, 2016

      @serhiy-storchaka
      Member

      Should the original exception be stored on the __context__ or the __cause__ attribute? In the latter case you should use _PyErr_FormatFromCause().

    5. ned-deily commented on Dec 7, 2016

      @ned-deily
      Member

      Yury, sounds like a bug to me so it would be appropriate for a maintenance release. And not a showstopper release critical.

    6. 1st1 commented on Dec 7, 2016

      @1st1
      MemberAuthor

      Ned, sounds good.

      Serhiy, we don't have _PyErr_FormatFromCause in 3.5, so I'll probably commit the patch as is in 3.5. For 3.6 is definitely makes sense to use _PyErr_FormatFromCause.

    7. 1st1 commented on Mar 3, 2017

      @1st1
      MemberAuthor

      New changeset dea5101 by Yury Selivanov in branch '3.6':
      bpo-28893: Set __cause__ for errors in async iteration protocol (#407)
      dea5101

    8. 1st1 commented on Mar 24, 2017

      @1st1
      MemberAuthor

      New changeset 398ff91 by Yury Selivanov in branch 'master':
      bpo-28893: Set __cause__ for errors in async iteration protocol (#407)
      398ff91

    9. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    3.7 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions