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

PyCF_ALLOW_TOP_LEVEL_AWAIT + list comprehension set .CO_COROUTINE falg. #85390

Closed
Carreau mannequin opened this issue Jul 6, 2020 · 9 comments
Closed

PyCF_ALLOW_TOP_LEVEL_AWAIT + list comprehension set .CO_COROUTINE falg. #85390

Carreau mannequin opened this issue Jul 6, 2020 · 9 comments
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker

Comments

@Carreau
Copy link
Mannequin

Carreau mannequin commented Jul 6, 2020

BPO 41218
Nosy @ambv, @Carreau, @pablogsal, @miss-islington
PRs
  • bpo-41218: Only mark async code with CO_COROUTINE. #21357
  • [3.8] bpo-41218: Only mark async code with CO_COROUTINE. (GH-21357) #21361
  • [3.9] bpo-41218: Only mark async code with CO_COROUTINE. (GH-21357) #21362
  • bpo-41218: Improve the test cases for test_compile_top_level_await_nocoro #21363
  • [3.9] bpo-41218: Improve the test cases for test_compile_top_level_await_no_coro (GH-21363) #21365
  • [3.8] bpo-41218: Improve the test cases for test_compile_top_level_await_no_coro (GH-21363) #21366
  • [3.9] bpo-41218: Improve the test cases for test_compile_top_level_await_no_coro (GH-21363) #22109
  • 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 2020-07-06.22:31:29.182>
    created_at = <Date 2020-07-06.15:00:52.413>
    labels = ['interpreter-core', '3.8', '3.9', '3.10', 'release-blocker']
    title = 'PyCF_ALLOW_TOP_LEVEL_AWAIT + list comprehension set .CO_COROUTINE  falg.'
    updated_at = <Date 2020-09-05.15:37:30.440>
    user = 'https://github.com/Carreau'

    bugs.python.org fields:

    activity = <Date 2020-09-05.15:37:30.440>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-07-06.22:31:29.182>
    closer = 'pablogsal'
    components = ['Interpreter Core']
    creation = <Date 2020-07-06.15:00:52.413>
    creator = 'mbussonn'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41218
    keywords = ['patch']
    message_count = 9.0
    messages = ['373128', '373130', '373157', '373176', '373180', '373189', '373190', '373193', '376431']
    nosy_count = 4.0
    nosy_names = ['lukasz.langa', 'mbussonn', 'pablogsal', 'miss-islington']
    pr_nums = ['21357', '21361', '21362', '21363', '21365', '21366', '22109']
    priority = 'release blocker'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue41218'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @Carreau
    Copy link
    Mannequin Author

    Carreau mannequin commented Jul 6, 2020

    As far as I can tell sometime in 3.8.x (likely 3.8.3) the following snippet changed result:

        import ast
        import inspect
        cell = '[x for x in l]'
        code = compile(cell, "<>", "exec", flags=getattr(ast,'PyCF_ALLOW_TOP_LEVEL_AWAIT', 0x0))
    inspect.CO_COROUTINE & code.co_flags == inspect.CO_COROUTINE
    

    Use to be False in 3.8.2 I believe and is False after.

    This is problematic when you try to detect top-level await code.

    @Carreau Carreau mannequin added 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Jul 6, 2020
    @Carreau
    Copy link
    Mannequin Author

    Carreau mannequin commented Jul 6, 2020

    (crossref ipython/ipython#12422)

    @Carreau
    Copy link
    Mannequin Author

    Carreau mannequin commented Jul 6, 2020

    https://bugs.python.org/issue39562 seem to have triggered that.

    @ambv
    Copy link
    Contributor

    ambv commented Jul 6, 2020

    New changeset bd46174 by Matthias Bussonnier in branch 'master':
    bpo-41218: Only mark async code with CO_COROUTINE. (bpo-21357)
    bd46174

    @miss-islington
    Copy link
    Contributor

    New changeset 41db8ff by Miss Islington (bot) in branch '3.8':
    bpo-41218: Only mark async code with CO_COROUTINE. (GH-21357)
    41db8ff

    @pablogsal
    Copy link
    Member

    New changeset c2c1f1f by Pablo Galindo in branch 'master':
    bpo-41218: Improve the test cases for test_compile_top_level_await_no_coro (GH-21363)
    c2c1f1f

    @pablogsal
    Copy link
    Member

    New changeset 6488a4a by Pablo Galindo in branch '3.9':
    [3.9] bpo-41218: Only mark async code with CO_COROUTINE. (GH-21357) (GH-21362)
    6488a4a

    @miss-islington
    Copy link
    Contributor

    New changeset b71ff9a by Miss Islington (bot) in branch '3.8':
    bpo-41218: Improve the test cases for test_compile_top_level_await_no_coro (GH-21363)
    b71ff9a

    @pablogsal
    Copy link
    Member

    New changeset a708ae7 by Miss Islington (bot) in branch '3.9':
    bpo-41218: Improve the test cases for test_compile_top_level_await_no_coro (GH-21363) (GH-22109)
    a708ae7

    @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 3.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants