[issue40000] Improve AST validation for Constant nodes

2020-03-19 Thread STINNER Victor
STINNER Victor added the comment: > _PyType_Name(Py_TYPE(value))) Why truncating the type name in the error message? The qualified name (don't call _PyType_Name()) should provide more information, no? -- ___ Python tracker

[issue40000] Improve AST validation for Constant nodes

2020-03-19 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ _

[issue40000] Improve AST validation for Constant nodes

2020-03-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 0ac59f93c0e3f91fd994d7245578cce65654fb22 by Batuhan Taşkaya in branch 'master': bpo-4: Improve error messages when validating invalid ast.Constant nodes (GH-19055) https://github.com/python/cpython/commit/0ac59f93c0e3f91fd994d7245578c

[issue40000] Improve AST validation for Constant nodes

2020-03-18 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: sorry to take it Victor, maybe you can get the perfect issue number when we migrate to github? -- ___ Python tracker ___ __

[issue40000] Improve AST validation for Constant nodes

2020-03-18 Thread STINNER Victor
STINNER Victor added the comment: Congratulations Batuhan! You win with the bug number 4! A nice number ;-) To be honest, I wanted to get it, but I didn't want to cheat by opening a stupid issue. -- nosy: +vstinner ___ Python tracker

[issue40000] Improve AST validation for Constant nodes

2020-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You got an anniversary issue! -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs

[issue40000] Improve AST validation for Constant nodes

2020-03-18 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- keywords: +patch pull_requests: +18407 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19055 ___ Python tracker ___

[issue40000] Improve AST validation for Constant nodes

2020-03-18 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- assignee: -> BTaskaya components: +Library (Lib) type: -> enhancement versions: +Python 3.9 ___ Python tracker ___

[issue40000] Improve AST validation for Constant nodes

2020-03-18 Thread Batuhan Taskaya
New submission from Batuhan Taskaya : When something that isn't constant found in a ast.Constant node's body, python reports errors like this >>> e = ast.Expression(body=ast.Constant(value=type)) >>> ast.fix_missing_locations(e) <_ast.Expression object at 0x7fc2c23981c0> >>> compile(e, "", "ev