Skip to content

Idle 2.7 -c, -r compile with print as function. #68410

Closed

Description

@terryjreedy
BPO 24222
Nosy @terryjreedy, @benjaminp

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/terryjreedy'
closed_at = <Date 2015-05-18.19:38:30.052>
created_at = <Date 2015-05-18.01:19:47.838>
labels = ['expert-IDLE', 'type-bug']
title = 'Idle 2.7 -c, -r compile with print as function.'
updated_at = <Date 2019-03-21.18:20:35.773>
user = 'https://github.com/terryjreedy'

bugs.python.org fields:

activity = <Date 2019-03-21.18:20:35.773>
actor = 'terry.reedy'
assignee = 'terry.reedy'
closed = True
closed_date = <Date 2015-05-18.19:38:30.052>
closer = 'terry.reedy'
components = ['IDLE']
creation = <Date 2015-05-18.01:19:47.838>
creator = 'terry.reedy'
dependencies = []
files = []
hgrepos = []
issue_num = 24222
keywords = []
message_count = 4.0
messages = ['243446', '243525', '243526', '243529']
nosy_count = 3.0
nosy_names = ['terry.reedy', 'benjamin.peterson', 'python-dev']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue24222'
versions = ['Python 2.7']

Activity

  1. terryjreedy commented on May 18, 2015

    @terryjreedy
    MemberAuthor
    C:\Users\Terry>py -2 -m idlelib.idle -c "print True"
    >>> 
    *** Error in script or command!
    Traceback (most recent call last):
      File "<pyshell#0>", line 1
        print True
                 ^
    SyntaxError: invalid syntax

    https://stackoverflow.com/questions/30280525/python-idle-give-a-false-syntax-error
    In answer, phihag points out that PyShell.py has future import and compiles with
    code = compile(source, filename, "exec")

    The fix is to add dont_inherit=True.

  2. self-assigned this
    on May 18, 2015
  3. added
    type-bug
    on May 18, 2015
  4. python-dev commented on May 18, 2015

    python-devmannequin
    Mannequin

    New changeset cebd51686565 by Terry Jan Reedy in branch '2.7':
    Issue bpo-24222: Fix regression introduced with idlelib/PyShell.py future print
    https://hg.python.org/cpython/rev/cebd51686565

  5. terryjreedy commented on May 18, 2015

    @terryjreedy
    MemberAuthor

    I added "from __future__ import print_function" to 2.7 PyShell when I backported the bugfix of bpo-22420. The use of print rather than write is part of the fix as print is more fault tolerant.

  6. terryjreedy commented on May 18, 2015

    @terryjreedy
    MemberAuthor

    This trivial patch fixes a regression I introduced in 2.7.9. It would be nice if you could pull it into the .10 release. (I would not ask if it were not a recent regression.)

  7. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

topic-IDLEtype-bug

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions