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

IDLE -s and (-, -c command, or -r file) produces error message #68453

Open
pppery mannequin opened this issue May 22, 2015 · 2 comments
Open

IDLE -s and (-, -c command, or -r file) produces error message #68453

pppery mannequin opened this issue May 22, 2015 · 2 comments
Assignees
Labels
3.10 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@pppery
Copy link
Mannequin

pppery mannequin commented May 22, 2015

BPO 24265
Nosy @terryjreedy, @kbkaiser, @serwy, @pppery

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 = None
created_at = <Date 2015-05-22.13:16:16.379>
labels = ['expert-IDLE', 'type-bug', '3.10']
title = 'IDLE -s and (-, -c command, or -r file) produces error message'
updated_at = <Date 2020-06-07.23:28:23.292>
user = 'https://github.com/pppery'

bugs.python.org fields:

activity = <Date 2020-06-07.23:28:23.292>
actor = 'terry.reedy'
assignee = 'terry.reedy'
closed = False
closed_date = None
closer = None
components = ['IDLE']
creation = <Date 2015-05-22.13:16:16.379>
creator = 'ppperry'
dependencies = []
files = []
hgrepos = []
issue_num = 24265
keywords = []
message_count = 2.0
messages = ['243824', '273523']
nosy_count = 4.0
nosy_names = ['terry.reedy', 'kbk', 'roger.serwy', 'ppperry']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'test needed'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue24265'
versions = ['Python 3.10']

@pppery
Copy link
Mannequin Author

pppery mannequin commented May 22, 2015

When I run "python -m idlelib.idle -sc [command] from the command line, IDLE runs the startup file, but then pops up an error message saying "the Python Shell window is already executing a command;please wait until it is finished." When the error window is closed, the command executes, unless the main Python Shell has already been closed, in which case a traceback occurs:
Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\lib\idlelib\idle.py", line 11, in <module>
    idlelib.PyShell.main()
  File "C:\Python27\lib\idlelib\PyShell.py", line 1602, in main
    shell.interp.execsource(cmd)
AttributeError: 'NoneType' object has no attribute 'execsource'

@pppery pppery mannequin added topic-IDLE type-bug An unexpected behavior, bug, or error labels May 22, 2015
@terryjreedy
Copy link
Member

I confirmed the bug on Win10 with 3.5 and 3.6. "python -m idlelibl -s" prints a prompt*, runs the file and prints any output, and prints a prompt. It then accepts user input. When "-c command" is added, it should accept that as user input (and perhaps display it on the input line). But I get the same error box. When clicked away, 'command' executes and a third prompt is displayed.

*Another bug. The startup file should run first, before a prompt, just as it does in python, and just as with files run with F5. It would not hurt if [Running <path>] were printed, but not a prompt. Prompts should mean 'ready to accept input'. Ditto for -c command, unless IDLE is changed to display the command after the prompt as if typed in.

Warning comes from ModifiedInterpreter (MI).dispaly_executing_dialog, which is called in MI.runcommand if 'self.tkconsole.executing'.  MI.runcommand is used for internal startup code and for '-', '-c', and '-r' on the command line, but not for user '>>> ' and editor code. 

I confirmed that '-s' + '-' or '-r' give the same warning. Hence the title change.

MI.tkconsole is the PyShell (PS) window instance. PS.executing is set/reset in PS.beginexecuting, PS.endexecuting. The latter should apparently be called someplace it is not now.

@terryjreedy terryjreedy changed the title IDLE produces error message when run with both -s and -c. IDLE -s and (-, -c command, or -r file) produces error message Aug 24, 2016
@terryjreedy terryjreedy added the 3.7 (EOL) end of life label Jun 30, 2017
@terryjreedy terryjreedy self-assigned this Jun 30, 2017
@terryjreedy terryjreedy added 3.10 only security fixes and removed 3.7 (EOL) end of life labels Jun 7, 2020
@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
3.10 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error
Projects
Status: No status
Development

No branches or pull requests

1 participant