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

ast_unparser.c doesn't handle := expressions #81007

Closed
ericvsmith opened this issue May 7, 2019 · 3 comments
Closed

ast_unparser.c doesn't handle := expressions #81007

ericvsmith opened this issue May 7, 2019 · 3 comments
Labels
3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker type-bug An unexpected behavior, bug, or error

Comments

@ericvsmith
Copy link
Member

BPO 36826
Nosy @ericvsmith, @ambv, @emilyemorehouse, @pablogsal, @isidentical
PRs
  • bpo-36826: Handle := in ast_unparse.c #13337
  • 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 2019-05-18.22:10:57.378>
    created_at = <Date 2019-05-07.08:39:53.109>
    labels = ['interpreter-core', 'type-bug', '3.8', 'release-blocker']
    title = "ast_unparser.c doesn't handle := expressions"
    updated_at = <Date 2019-05-18.22:10:57.377>
    user = 'https://github.com/ericvsmith'

    bugs.python.org fields:

    activity = <Date 2019-05-18.22:10:57.377>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-05-18.22:10:57.378>
    closer = 'pablogsal'
    components = ['Interpreter Core']
    creation = <Date 2019-05-07.08:39:53.109>
    creator = 'eric.smith'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36826
    keywords = ['patch']
    message_count = 3.0
    messages = ['341699', '342560', '342820']
    nosy_count = 5.0
    nosy_names = ['eric.smith', 'lukasz.langa', 'emilyemorehouse', 'pablogsal', 'BTaskaya']
    pr_nums = ['13337']
    priority = 'release blocker'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue36826'
    versions = ['Python 3.8']

    @ericvsmith
    Copy link
    Member Author

    If either of these lines are added to test_annotations() in Lib/test/test_future.py, a SystemError will be raised:

        eq("(x:=10)")
        eq("f'{(x:=10):=10}'")
    
    Traceback (most recent call last):
      File "/Users/eric/local/python/cpython/Lib/test/test_future.py", line 258, in test_annotations
        eq("(x:=10)")
      File "/Users/eric/local/python/cpython/Lib/test/test_future.py", line 134, in assertAnnotationEqual
        actual = self.getActual(annotation)
      File "/Users/eric/local/python/cpython/Lib/test/test_future.py", line 121, in getActual
        exec(self.template.format(ann=annotation), {}, scope)
    SystemError: unknown expression kind

    @ericvsmith ericvsmith added 3.8 only security fixes release-blocker interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels May 7, 2019
    @isidentical
    Copy link
    Sponsor Member

    I have patch, i'm going to submit it.

    @pablogsal
    Copy link
    Member

    Thanks for the patch Batuhan!

    @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 interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants