Issue40000
Created on 2020-03-18 09:46 by BTaskaya, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 19055 | merged | BTaskaya, 2020-03-18 09:56 | |
| Messages (6) | |||
|---|---|---|---|
| msg364505 - (view) | Author: Batuhan Taskaya (BTaskaya) * | Date: 2020-03-18 09:46 | |
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, "<test>", "eval") Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: got an invalid type in Constant: type But if something is part of constant tuple and frozenset isn't constant, the error reporting is wrong >>> e = ast.Expression(body=ast.Constant(value=(1,2,type))) >>> compile(e, "<test>", "eval") Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: got an invalid type in Constant: tuple This should've been TypeError: got an invalid type in Constant: type |
|||
| msg364509 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2020-03-18 10:07 | |
You got an anniversary issue! |
|||
| msg364529 - (view) | Author: STINNER Victor (vstinner) * | Date: 2020-03-18 15:49 | |
Congratulations Batuhan! You win with the bug number 40000! A nice number ;-) To be honest, I wanted to get it, but I didn't want to cheat by opening a stupid issue. |
|||
| msg364530 - (view) | Author: Batuhan Taskaya (BTaskaya) * | Date: 2020-03-18 16:02 | |
sorry to take it Victor, maybe you can get the perfect issue number when we migrate to github? |
|||
| msg364599 - (view) | Author: Pablo Galindo Salgado (pablogsal) * | Date: 2020-03-19 11:32 | |
New changeset 0ac59f93c0e3f91fd994d7245578cce65654fb22 by Batuhan Taşkaya in branch 'master': bpo-40000: Improve error messages when validating invalid ast.Constant nodes (GH-19055) https://github.com/python/cpython/commit/0ac59f93c0e3f91fd994d7245578cce65654fb22 |
|||
| msg364626 - (view) | Author: STINNER Victor (vstinner) * | Date: 2020-03-19 18:43 | |
> _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? |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:28 | admin | set | github: 84181 |
| 2020-03-19 18:43:55 | vstinner | set | messages: + msg364626 |
| 2020-03-19 12:01:11 | BTaskaya | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2020-03-19 11:32:51 | pablogsal | set | nosy:
+ pablogsal messages: + msg364599 |
| 2020-03-18 16:02:42 | BTaskaya | set | messages: + msg364530 |
| 2020-03-18 15:49:39 | vstinner | set | nosy:
+ vstinner messages: + msg364529 |
| 2020-03-18 10:07:02 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg364509 |
| 2020-03-18 09:56:54 | BTaskaya | set | keywords:
+ patch stage: patch review pull_requests: + pull_request18407 |
| 2020-03-18 09:47:08 | BTaskaya | set | assignee: BTaskaya type: enhancement components: + Library (Lib) versions: + Python 3.9 |
| 2020-03-18 09:46:11 | BTaskaya | create | |