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 with unicode kinded constants #83703

Closed
isidentical opened this issue Feb 1, 2020 · 7 comments
Closed

AST Unparser with unicode kinded constants #83703

isidentical opened this issue Feb 1, 2020 · 7 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@isidentical
Copy link
Sponsor Member

BPO 39522
Nosy @vstinner, @pablogsal, @isidentical
PRs
  • bpo-39522: Correctly unparse unicode prefix in ast_unparse.c #19512
  • bpo-39522: Use _PyUnicodeWriter_WriteStr instead of append charp #19523
  • bpo-39522: Always initialize kind attribute in constant ast nodes #19525
  • 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-04-15.03:06:52.789>
    created_at = <Date 2020-02-01.23:35:59.495>
    labels = ['interpreter-core', '3.8', 'type-bug', '3.7', '3.9']
    title = 'AST Unparser with unicode kinded constants'
    updated_at = <Date 2020-04-15.03:06:52.788>
    user = 'https://github.com/isidentical'

    bugs.python.org fields:

    activity = <Date 2020-04-15.03:06:52.788>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-04-15.03:06:52.789>
    closer = 'pablogsal'
    components = ['Interpreter Core']
    creation = <Date 2020-02-01.23:35:59.495>
    creator = 'BTaskaya'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39522
    keywords = ['patch']
    message_count = 7.0
    messages = ['361199', '366441', '366442', '366470', '366471', '366482', '366483']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'pablogsal', 'BTaskaya']
    pr_nums = ['19512', '19523', '19525']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue39522'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @isidentical
    Copy link
    Sponsor Member Author

    >>> from __future__ import annotations
    >>> import ast
    >>> x: u"a" = 3
    >>> __annotations__["x"]
    "'a'"
    >>> ast.dump(ast.parse(__annotations__["x"])) == ast.dump(ast.parse('u"a"'))
    False

    I guess before touching constant part, we should wait for #61628 (afterward I can prepare a patch)

    @isidentical isidentical added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Feb 1, 2020
    @pablogsal
    Copy link
    Member

    New changeset 43aeefa by Batuhan Taşkaya in branch 'master':
    bpo-39522: Use _PyUnicodeWriter_WriteStr instead of PyUnicode_AS_DATA (GH-19523)
    43aeefa

    @pablogsal
    Copy link
    Member

    New changeset 3398646 by Pablo Galindo in branch 'master':
    bpo-39522: Always initialise kind attribute in constant ast nodes (GH-19525)
    3398646

    @vstinner
    Copy link
    Member

    commit aade1cc
    Author: Batuhan Taşkaya <batuhanosmantaskaya@gmail.com>
    Date: Tue Apr 14 21:55:01 2020 +0300

    bpo-395222: Correctly unparse unicode prefix in ast_unparse.c (GH-19512)
    

    @vstinner
    Copy link
    Member

    Many buildbots failed. Example:

    https://buildbot.python.org/all/#/builders/500/builds/288

    ======================================================================
    FAIL: test_annotations (test.test_future.AnnotationsFutureTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.lto/build/Lib/test/test_future.py", line 156, in test_annotations
        eq("u'some_string'")
      File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.lto/build/Lib/test/test_future.py", line 150, in assertAnnotationEqual
        self.assertEqual(actual, expected)
    AssertionError: "'some_string'" != "u'some_string'"
    - 'some_string'
    + u'some_string'
    ? +

    @vstinner vstinner reopened this Apr 15, 2020
    @vstinner vstinner reopened this Apr 15, 2020
    @pablogsal
    Copy link
    Member

    I think that this was fixes by PR19525 and PR19523. For instance, the buildbot you mentioned is green when building those PRs:

    https://buildbot.python.org/all/#/builders/500/builds/289

    @pablogsal
    Copy link
    Member

    I checked and all current buildbot failures are related to the refleak in test_threading so I think this issue is fixed. I will close the issue, please reopen of I missed something or you would like to address something else :)

    @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.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes 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

    3 participants