Issue24975
Created on 2015-09-01 01:13 by dabeaz, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue24975.patch | yselivanov, 2015-09-01 03:04 | review | ||
| Messages (11) | |||
|---|---|---|---|
| msg249442 - (view) | Author: David Beazley (dabeaz) | Date: 2015-09-01 01:13 | |
The compile() function is not able to compile an AST created from code that uses some of the new unpacking generalizations in PEP 448. Example: code = ''' a = { 'x':1, 'y':2 } b = { **a, 'z': 3 } ''' # Works ccode = compile(code, '', 'exec') # Crashes import ast tree = ast.parse(code) ccode = compile(tree, '', 'exec') # ---------------------------------- Error Traceback: Traceback (most recent call last): File "bug.py", line 11, in <module> ccode = compile(tree, '', 'exec') ValueError: None disallowed in expression list Note: This bug makes it impossible to try generalized unpacking examples interactively in IPython. |
|||
| msg249448 - (view) | Author: Yury Selivanov (yselivanov) * | Date: 2015-09-01 03:04 | |
Good find, David. Thanks! Please review the attached patch. |
|||
| msg249451 - (view) | Author: Larry Hastings (larry) * | Date: 2015-09-01 04:01 | |
Good catch! Please file a pull request via bitbucket. |
|||
| msg249452 - (view) | Author: Alyssa Coghlan (ncoghlan) * | Date: 2015-09-01 05:14 | |
Patch looks good to me. I was initially going to query the changes to the break/continue AST tests, but then realised they were needed to avoid a compile error for break/continue outside a loop now that we ensure the resulting AST can be used to generate code. |
|||
| msg249498 - (view) | Author: Brett Cannon (brett.cannon) * | Date: 2015-09-01 18:13 | |
Do we not have a test that compiles the entire stdlib using the ast module? We used to have one for the old compiler package. If don't have such a test we should probably add it even if it requires a -u option. |
|||
| msg249515 - (view) | Author: Yury Selivanov (yselivanov) * | Date: 2015-09-01 20:13 | |
Larry, I created a PR for you: https://bitbucket.org/larry/cpython350/pull-requests/10/issue-24975-fix-ast-compilation-for-pep/diff Brett, Should we do that in a separate issue targeting 3.6 only? |
|||
| msg249517 - (view) | Author: Brett Cannon (brett.cannon) * | Date: 2015-09-01 20:49 | |
Created issue #24981 to track the test case idea. |
|||
| msg249563 - (view) | Author: Larry Hastings (larry) * | Date: 2015-09-02 19:37 | |
Merged. Please forward-merge to 3.5.1 and 3.6, thanks! |
|||
| msg249564 - (view) | Author: Roundup Robot (python-dev) | Date: 2015-09-02 19:50 | |
New changeset e9df8543d7bc by Yury Selivanov in branch '3.5': Issue #24975: Fix AST compilation for PEP 448 syntax. https://hg.python.org/cpython/rev/e9df8543d7bc New changeset ea79be5b201e by Yury Selivanov in branch '3.5': Merge 3.5 heads (issue #24975) https://hg.python.org/cpython/rev/ea79be5b201e New changeset 1dcd7f257ed8 by Yury Selivanov in branch 'default': Merge 3.5 (issue #24975) https://hg.python.org/cpython/rev/1dcd7f257ed8 |
|||
| msg249565 - (view) | Author: Yury Selivanov (yselivanov) * | Date: 2015-09-02 19:51 | |
Thanks Nick and Larry for code reviews and merge! |
|||
| msg249838 - (view) | Author: Terry J. Reedy (terry.reedy) * | Date: 2015-09-04 21:46 | |
Upon writing a proof-of-concept file for #24981, I discovered an stdlib file that gave the same error. C:/programs/Python35/Lib\distutils/_msvccompiler.py ValueError: None disallowed in expression list I presume the applied fix will apply to this also. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:20 | admin | set | nosy:
+ ned.deily github: 69163 |
| 2015-09-04 21:46:54 | terry.reedy | set | nosy:
+ terry.reedy messages: + msg249838 |
| 2015-09-02 19:51:32 | yselivanov | set | status: open -> closed resolution: fixed messages: + msg249565 stage: patch review -> resolved |
| 2015-09-02 19:50:36 | python-dev | set | nosy:
+ python-dev messages: + msg249564 |
| 2015-09-02 19:37:53 | larry | set | messages: + msg249563 |
| 2015-09-01 20:49:43 | brett.cannon | set | messages: + msg249517 |
| 2015-09-01 20:13:17 | yselivanov | set | messages: + msg249515 |
| 2015-09-01 18:13:40 | brett.cannon | set | nosy:
+ brett.cannon messages: + msg249498 |
| 2015-09-01 05:14:28 | ncoghlan | set | messages: + msg249452 |
| 2015-09-01 04:01:54 | larry | set | messages: + msg249451 |
| 2015-09-01 03:04:02 | yselivanov | set | files:
+ issue24975.patch priority: normal -> release blocker versions:
+ Python 3.6 messages:
+ msg249448 |
| 2015-09-01 01:13:16 | dabeaz | create | |