classification
Title: AST Unparser with unicode kinded constants
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, pablogsal, vstinner
Priority: normal Keywords: patch

Created on 2020-02-01 23:35 by BTaskaya, last changed 2020-04-15 03:06 by pablogsal. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 19512 merged BTaskaya, 2020-04-14 15:54
PR 19523 merged BTaskaya, 2020-04-14 19:24
PR 19525 merged pablogsal, 2020-04-14 20:13
Messages (7)
msg361199 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-02-01 23:35
>>> 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 GH-17426 (afterward I can prepare a patch)
msg366441 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-04-14 20:21
New changeset 43aeefa41915e4d3b0e68bbd4268c1c378a72dce by Batuhan Taşkaya in branch 'master':
bpo-39522: Use _PyUnicodeWriter_WriteStr instead of PyUnicode_AS_DATA (GH-19523)
https://github.com/python/cpython/commit/43aeefa41915e4d3b0e68bbd4268c1c378a72dce
msg366442 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-04-14 20:40
New changeset 33986465bde2a2188537c4ef6cdb6055e348f31f by Pablo Galindo in branch 'master':
bpo-39522: Always initialise kind attribute in constant ast nodes (GH-19525)
https://github.com/python/cpython/commit/33986465bde2a2188537c4ef6cdb6055e348f31f
msg366470 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-04-15 01:03
commit aade1cc453698e1bc48861b16955c2c2219ec521
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)
msg366471 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-04-15 01:06
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'
? +


----------------------------------------------------------------------
msg366482 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-04-15 03:05
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
msg366483 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-04-15 03:06
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 :)
History
Date User Action Args
2020-04-15 03:06:52pablogsalsetstatus: open -> closed
resolution: fixed
messages: + msg366483
2020-04-15 03:05:16pablogsalsetmessages: + msg366482
2020-04-15 01:06:17vstinnersetstatus: closed -> open
resolution: fixed -> (no value)
messages: + msg366471
2020-04-15 01:03:29vstinnersetnosy: + vstinner
messages: + msg366470
2020-04-14 20:41:03pablogsalsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-04-14 20:40:44pablogsalsetmessages: + msg366442
2020-04-14 20:21:30pablogsalsetmessages: + msg366441
2020-04-14 20:13:20pablogsalsetnosy: + pablogsal
pull_requests: + pull_request18875
2020-04-14 19:24:05BTaskayasetpull_requests: + pull_request18873
2020-04-14 15:54:58BTaskayasetkeywords: + patch
stage: patch review
pull_requests: + pull_request18865
2020-02-01 23:35:59BTaskayacreate