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.
Created on 2020年04月21日 19:59 by brandtbucher, last changed 2022年04月11日 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 19868 | merged | curtisbucher, 2020年05月02日 21:48 | |
| PR 19947 | closed | miss-islington, 2020年05月05日 19:41 | |
| Messages (4) | |||
|---|---|---|---|
| msg366938 - (view) | Author: Brandt Bucher (brandtbucher) * (Python committer) | Date: 2020年04月21日 19:59 | |
There are several places in the ast module where the use of zip is allowing malformed nodes to have unpaired children silently thrown away. A couple of short examples:
>>> from ast import Constant, Dict, literal_eval, unparse
>>> nasty_dict = Dict(keys=[Constant("I don't have a value!")], values=[])
>>> unparse(nasty_dict)
'{}'
>>> literal_eval(nasty_dict)
{}
I'm currently working on a patch to raise errors instead.
|
|||
| msg366941 - (view) | Author: Batuhan Taskaya (BTaskaya) * (Python committer) | Date: 2020年04月21日 21:03 | |
See https://bugs.python.org/msg360767 for ast.unparse's point of view regarding malformed nodes. |
|||
| msg368200 - (view) | Author: Pablo Galindo Salgado (pablogsal) * (Python committer) | Date: 2020年05月05日 19:41 | |
New changeset c21c51235aa8061da6b0593d6f857f42fd92fd8b by Curtis Bucher in branch 'master': bpo-40355: Improve error messages in ast.literal_eval with malformed Dict nodes (GH-19868) https://github.com/python/cpython/commit/c21c51235aa8061da6b0593d6f857f42fd92fd8b |
|||
| msg368202 - (view) | Author: miss-islington (miss-islington) | Date: 2020年05月05日 20:01 | |
New changeset 2a3b876b0286b22a9058510d9e51dc4d60eeb89a by Miss Islington (bot) in branch '3.8': bpo-40355: Improve error messages in ast.literal_eval with malformed Dict nodes (GH-19868) https://github.com/python/cpython/commit/2a3b876b0286b22a9058510d9e51dc4d60eeb89a |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:59:29 | admin | set | github: 84535 |
| 2020年05月06日 08:21:23 | BTaskaya | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2020年05月05日 20:01:04 | miss-islington | set | messages: + msg368202 |
| 2020年05月05日 19:41:10 | miss-islington | set | nosy:
+ miss-islington pull_requests: + pull_request19262 |
| 2020年05月05日 19:41:04 | pablogsal | set | messages: + msg368200 |
| 2020年05月02日 21:48:12 | curtisbucher | set | keywords:
+ patch nosy: + curtisbucher pull_requests: + pull_request19181 stage: patch review |
| 2020年04月21日 21:03:28 | BTaskaya | set | nosy:
+ pablogsal, BTaskaya messages: + msg366941 |
| 2020年04月21日 20:33:45 | remi.lapeyre | set | nosy:
+ remi.lapeyre |
| 2020年04月21日 19:59:22 | brandtbucher | create | |