This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yan12125
Recipients yan12125
Date 2019-05-26.12:41:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Currently (135c6a56e55d2f4f8718b3b9f03ce3c692b15f0f) the following test fails:

./python -m test.regrtest -v test_tools.test_unparse -u cpu

(Note that -u cpu is needed to force test_unparse.DirectoryTestCase to check all files under Lib/ and Lib/test/.)

An example error message:

FAIL: test_files (test.test_tools.test_unparse.DirectoryTestCase) (filename='/home/yen/Projects/cpython/Lib/test/'
Traceback (most recent call last):
  File "/home/yen/Projects/cpython/Lib/test/test_tools/", line 309, in test_files
  File "/home/yen/Projects/cpython/Lib/test/test_tools/", line 132, in check_roundtrip
    self.assertASTEqual(ast1, ast2)
  File "/home/yen/Projects/cpython/Lib/test/test_tools/", line 124, in assertASTEqual
    self.assertEqual(ast.dump(ast1), ast.dump(ast2))
AssertionError: 'Modu[88178 chars]kind=\'u\')], ctx=Load())), ctx=Load()))], dec[421987 chars]=[])' != 'Modu[88178 chars]kind=No
ne)], ctx=Load())), ctx=Load()))], deco[421986 chars]=[])'


Apparently that's because Tools/parser/ does not handle strings like u"bar" correctly. I managed to "fix" it with the following patch:

diff --git a/Tools/parser/ b/Tools/parser/
index 385902ef4b..a25b5e49df 100644
--- a/Tools/parser/
+++ b/Tools/parser/
@@ -399,6 +399,8 @@ class Unparser:
         elif value is ...:
+            if t.kind == 'u':
+                self.write("u")

     def _List(self, t):

Not sure if this is the correct approach, though.
Date User Action Args
2019-05-26 12:41:33yan12125setrecipients: + yan12125
2019-05-26 12:41:33yan12125setmessageid: <>
2019-05-26 12:41:33yan12125linkissue37053 messages
2019-05-26 12:41:33yan12125create