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

DeprecationWarning for PEP 479 (generator_stop) #70324

Closed
vadmium opened this issue Jan 17, 2016 · 11 comments
Closed

DeprecationWarning for PEP 479 (generator_stop) #70324

vadmium opened this issue Jan 17, 2016 · 11 comments
Labels
easy interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@vadmium
Copy link
Member

vadmium commented Jan 17, 2016

BPO 26136
Nosy @ezio-melotti, @vadmium, @AnishShah
Files
  • issue26136_20160202.patch
  • issue26136_20160203.patch
  • issue26136_20160204.patch
  • issue26136_20160207.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 2016-02-10.06:42:13.862>
    created_at = <Date 2016-01-17.03:31:19.475>
    labels = ['interpreter-core', 'easy', 'type-bug']
    title = 'DeprecationWarning for PEP 479 (generator_stop)'
    updated_at = <Date 2016-02-10.06:42:13.860>
    user = 'https://github.com/vadmium'

    bugs.python.org fields:

    activity = <Date 2016-02-10.06:42:13.860>
    actor = 'martin.panter'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-02-10.06:42:13.862>
    closer = 'martin.panter'
    components = ['Interpreter Core']
    creation = <Date 2016-01-17.03:31:19.475>
    creator = 'martin.panter'
    dependencies = []
    files = ['41783', '41794', '41800', '41840']
    hgrepos = []
    issue_num = 26136
    keywords = ['patch', 'easy']
    message_count = 11.0
    messages = ['258448', '259407', '259454', '259489', '259529', '259536', '259735', '259759', '259763', '259977', '259984']
    nosy_count = 4.0
    nosy_names = ['ezio.melotti', 'python-dev', 'martin.panter', 'anish.shah']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue26136'
    versions = ['Python 3.6']

    @vadmium
    Copy link
    Member Author

    vadmium commented Jan 17, 2016

    PEP-479 says “Python 3.6: Non-silent deprecation warning” if “StopIteration bubbles out of a generator not under __future__ import”. Currently I see a PendingDeprecationWarning in this case; I guess this should be changed to DeprecationWarning in the 3.6 branch.

    @vadmium vadmium added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Jan 17, 2016
    @AnishShah
    Copy link
    Mannequin

    AnishShah mannequin commented Feb 2, 2016

    I have submitted a patch. I have replace PyExc_PendingDeprecationWarning to PyExc_DeprecationWarning in Objects/genobject.c

    Can anyone please review?

    @vadmium
    Copy link
    Member Author

    vadmium commented Feb 3, 2016

    Have you tried running the test suite? I suspect there are tests that will fail. E.g. the tests in revision 2771a0ac806b would need to be changed over to DeprecationWarning as well.

    @AnishShah
    Copy link
    Mannequin

    AnishShah mannequin commented Feb 3, 2016

    Yes @martin.panter, the tests were failing. But, I didn't know where the tests for PendingDeprecationWarning were added. Thanks for telling the changeset. I have updated the patch. Can you please have a look?

    @vadmium
    Copy link
    Member Author

    vadmium commented Feb 4, 2016

    FYI I found that changeset by doing annotate on the file that you originally changed <https://hg.python.org/cpython/annotate/default/Objects/genobject.c#l181\>, which is an index of the changesets that last modified each line.

    Thanks for the patch, I think it is generally good. Perhaps this also needs a short notice in What’s New, a bit like <https://docs.python.org/3/whatsnew/3.5.html#deprecated-python-behavior\>?

    @AnishShah
    Copy link
    Mannequin

    AnishShah mannequin commented Feb 4, 2016

    Thanks @martin.panter. I learnt something new, I didn't know about annotate before.
    I have updated the patch.
    Thanks again.

    @AnishShah
    Copy link
    Mannequin

    AnishShah mannequin commented Feb 6, 2016

    @martin.panter Any reviews for the patch? Is it ready to merge?

    @vadmium
    Copy link
    Member Author

    vadmium commented Feb 7, 2016

    Thanks for the updated patch. There are a couple minor problems with the What’s New entry, which you can fix if you want, or I could fix if I get around to merging it:

    • Bullet point should probably be wrapped onto multiple lines
    • According to the 3.5 What’s New, the DeprecationWarning is “non-silent”, but I would just drop the “silent” attribute (Once upon a time in Python 2, DeprecationWarning was apparently enabled by default, in constrast with PendingDeprecationWarning, which was silenced by default.)
    • Change “which will trigger a RuntimeError” → “and will trigger . . .”
    • Missing full stop at the end

    @AnishShah
    Copy link
    Mannequin

    AnishShah mannequin commented Feb 7, 2016

    @martin.panter I have fixed the What's New docs. I have updated the patch. Thanks!

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Feb 10, 2016

    New changeset 73f89182bb4d by Martin Panter in branch 'default':
    Issue bpo-26136: Upgrade the generator_stop warning to DeprecationWarning
    https://hg.python.org/cpython/rev/73f89182bb4d

    @vadmium
    Copy link
    Member Author

    vadmium commented Feb 10, 2016

    Thanks for your work Anish

    @vadmium vadmium closed this as completed Feb 10, 2016
    @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
    easy 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

    2 participants