Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py2_test_grammar.py contains invalid syntax for 2.6 #52488

Closed
ggenellina mannequin opened this issue Mar 27, 2010 · 6 comments
Closed

py2_test_grammar.py contains invalid syntax for 2.6 #52488

ggenellina mannequin opened this issue Mar 27, 2010 · 6 comments
Assignees
Labels
topic-installation type-bug An unexpected behavior, bug, or error

Comments

@ggenellina
Copy link
Mannequin

ggenellina mannequin commented Mar 27, 2010

BPO 8241
Nosy @loewis, @benjaminp
Files
  • py2_test_grammar.patch: Fix with statement syntax invalid problem in py2_test_grammar.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/loewis'
    closed_at = <Date 2010-08-04.15:47:59.158>
    created_at = <Date 2010-03-27.00:48:59.124>
    labels = ['type-bug', 'expert-installation']
    title = 'py2_test_grammar.py contains invalid syntax for 2.6'
    updated_at = <Date 2010-08-04.15:47:59.157>
    user = 'https://bugs.python.org/ggenellina'

    bugs.python.org fields:

    activity = <Date 2010-08-04.15:47:59.157>
    actor = 'loewis'
    assignee = 'loewis'
    closed = True
    closed_date = <Date 2010-08-04.15:47:59.158>
    closer = 'loewis'
    components = ['Installation']
    creation = <Date 2010-03-27.00:48:59.124>
    creator = 'ggenellina'
    dependencies = []
    files = ['16865']
    hgrepos = []
    issue_num = 8241
    keywords = ['patch']
    message_count = 6.0
    messages = ['101779', '101814', '102809', '102815', '102836', '112824']
    nosy_count = 4.0
    nosy_names = ['loewis', 'ggenellina', 'benjamin.peterson', 'gombiuda']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'needs patch'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue8241'
    versions = ['Python 2.6']

    @ggenellina
    Copy link
    Mannequin Author

    ggenellina mannequin commented Mar 27, 2010

    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 bpo-6716.

    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.

    @ggenellina ggenellina mannequin added topic-2to3 type-bug An unexpected behavior, bug, or error labels Mar 27, 2010
    @benjaminp
    Copy link
    Contributor

    The correct thing to do is actually to ignore py2_test_grammar.py when compiling the pyc files.

    @benjaminp benjaminp assigned loewis and unassigned benjaminp Mar 27, 2010
    @gombiuda
    Copy link
    Mannequin

    gombiuda mannequin commented Apr 11, 2010

    I have upload a patch for this problem by just removing the lines as Gabriel said.

    Please check it out. Thanks.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Apr 11, 2010

    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.

    @loewis loewis mannequin added topic-installation and removed topic-2to3 labels Apr 11, 2010
    @benjaminp
    Copy link
    Contributor

    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.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Aug 4, 2010

    I have now fixed this with r83721, by excluding the file from compileall.

    @loewis loewis mannequin closed this as completed Aug 4, 2010
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    topic-installation type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant