Issue 8241: py2_test_grammar.py contains invalid syntax for 2.6
Created on 2010-03-27 00:48 by ggenellina, last changed 2022-04-11 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| py2_test_grammar.patch | gombiuda, 2010-04-11 04:29 | Fix `with statement` syntax invalid problem in py2_test_grammar.py | ||
| Messages (6) | |||
|---|---|---|---|
| msg101779 - (view) | Author: Gabriel Genellina (ggenellina) | Date: 2010-03-27 00:48 | |
Lib\lib2to3\tests\data\py2_test_grammar.py, in test_with_statement, requires a variant of the with statement (multiple targets) that is not available in Python 2.6. Compiling py2_test_grammar.py raises a SyntaxError. This makes the 2.6.5 installer exit with an error message when asked to pre-compile all .pyc files, as reported in issue6716. The fix is simply to remove the last three 'with' statements in function test_with_statement, around line 923 in Lib\lib2to3\tests\data\py2_test_grammar.py, as this is invalid code for this Python version. |
|||
| msg101814 - (view) | Author: Benjamin Peterson (benjamin.peterson) * ![]() |
Date: 2010-03-27 01:06 | |
The correct thing to do is actually to ignore py2_test_grammar.py when compiling the pyc files. |
|||
| msg102809 - (view) | Author: Gombiuda Jiang (gombiuda) | Date: 2010-04-11 04:29 | |
I have upload a patch for this problem by just removing the lines as Gabriel said. Please check it out. Thanks. |
|||
| msg102815 - (view) | Author: Martin v. Löwis (loewis) * ![]() |
Date: 2010-04-11 08:25 | |
Benjamin, ISTM that the tests in lib2to3/tests/data/py2_test_grammar aren't run at all, as part of regrtest. If so, the entire file could be removed. |
|||
| msg102836 - (view) | Author: Benjamin Peterson (benjamin.peterson) * ![]() |
Date: 2010-04-11 14:20 | |
2010/4/11 Martin v. Löwis <report@bugs.python.org>: > > Martin v. Löwis <martin@v.loewis.de> added the comment: > > Benjamin, ISTM that the tests in lib2to3/tests/data/py2_test_grammar aren't run at all, as part of regrtest. If so, the entire file could be removed. True, but then it would become out of sync with the other branches. The tests aren't run in the trunk either, but we keep the file there. |
|||
| msg112824 - (view) | Author: Martin v. Löwis (loewis) * ![]() |
Date: 2010-08-04 15:47 | |
I have now fixed this with r83721, by excluding the file from compileall. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:56:59 | admin | set | github: 52488 |
| 2010-08-04 15:47:59 | loewis | set | status: open -> closed resolution: fixed messages: + msg112824 |
| 2010-04-11 14:20:02 | benjamin.peterson | set | messages: + msg102836 |
| 2010-04-11 08:25:03 | loewis | set | nosy:
loewis, ggenellina, benjamin.peterson, gombiuda messages: + msg102815 components: + Installation, - 2to3 (2.x to 3.x conversion tool) |
| 2010-04-11 04:29:18 | gombiuda | set | files:
+ py2_test_grammar.patch nosy:
+ gombiuda keywords: + patch |
| 2010-03-27 01:06:06 | benjamin.peterson | set | assignee: benjamin.peterson -> loewis |
| 2010-03-27 00:50:53 | ezio.melotti | set | priority: normal assignee: benjamin.peterson nosy:
+ benjamin.peterson |
| 2010-03-27 00:48:59 | ggenellina | create | |
