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

asyncio.gather no DeprecationWarning if task are passed #88978

Closed
Dreamsorcerer mannequin opened this issue Aug 2, 2021 · 5 comments
Closed

asyncio.gather no DeprecationWarning if task are passed #88978

Dreamsorcerer mannequin opened this issue Aug 2, 2021 · 5 comments
Labels
3.8 only security fixes 3.9 only security fixes topic-asyncio

Comments

@Dreamsorcerer
Copy link
Mannequin

Dreamsorcerer mannequin commented Aug 2, 2021

BPO 44815
Nosy @asvetlov, @ambv, @1st1, @yan12125, @Dreamsorcerer
PRs
  • bpo-44815: Always show deprecation in asyncio.gather/sleep() #27568
  • [3.9] bpo-44815: Always show deprecation in asyncio.gather/sleep() #27569
  • 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 2021-08-18.18:58:54.184>
    created_at = <Date 2021-08-02.18:29:57.219>
    labels = ['3.8', '3.9', 'expert-asyncio']
    title = 'asyncio.gather no DeprecationWarning if task are passed'
    updated_at = <Date 2021-09-04.02:42:34.542>
    user = 'https://github.com/Dreamsorcerer'

    bugs.python.org fields:

    activity = <Date 2021-09-04.02:42:34.542>
    actor = 'yan12125'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-08-18.18:58:54.184>
    closer = 'lukasz.langa'
    components = ['asyncio']
    creation = <Date 2021-08-02.18:29:57.219>
    creator = 'dreamsorcerer'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44815
    keywords = ['patch']
    message_count = 5.0
    messages = ['398794', '398797', '399862', '399864', '401033']
    nosy_count = 5.0
    nosy_names = ['asvetlov', 'lukasz.langa', 'yselivanov', 'yan12125', 'dreamsorcerer']
    pr_nums = ['27568', '27569']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue44815'
    versions = ['Python 3.8', 'Python 3.9']

    @Dreamsorcerer
    Copy link
    Mannequin Author

    Dreamsorcerer mannequin commented Aug 2, 2021

    When calling asyncio.gather() a DeprecationWarning is only emitted if no tasks are passed (which is probably the exceptional case, rather than the standard one).

    This has resulted in us missing this deprecated argument in aiohttp until we received a bug report from a user trying it out against the 3.10 beta.

    For some reason the warning only appears under a `if not coros_or_futures:` block. I think it should be run regardless:
    https://github.com/python/cpython/blob/3.9/Lib/asyncio/tasks.py#L757

    @Dreamsorcerer Dreamsorcerer mannequin added 3.8 only security fixes 3.9 only security fixes topic-asyncio labels Aug 2, 2021
    @Dreamsorcerer
    Copy link
    Mannequin Author

    Dreamsorcerer mannequin commented Aug 2, 2021

    There is another issue with asyncio.sleep() too, if the passed argument is 0. This also tripped up the tests in aiohttp (though I've also used an explicit 0 in production code to yield back to the loop).

    @ambv
    Copy link
    Contributor

    ambv commented Aug 18, 2021

    New changeset b2779b2 by Sam Bull in branch '3.9':
    [3.9] bpo-44815: Always show deprecation in asyncio.gather/sleep() (GH-27569)
    b2779b2

    @ambv
    Copy link
    Contributor

    ambv commented Aug 18, 2021

    Thanks, Sam! ✨ 🍰 ✨

    @ambv ambv closed this as completed Aug 18, 2021
    @ambv ambv closed this as completed Aug 18, 2021
    @yan12125
    Copy link
    Mannequin

    yan12125 mannequin commented Sep 4, 2021

    A regression in 3.9.7 (bpo-45097) seems related to this issue. Could you have a look?

    @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 topic-asyncio
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant