This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients Saimadhav.Heblikar, asvetlov, ggenellina, gpolo, louielu, markroseman, mcepl, mrabarnett, rhettinger, terry.reedy, veganaiZe, wolma
Date 2019-06-02.00:15:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
3 recent 'doit' requests (2 on PR 1589) raise my priority for this issue.

When a user runs a file from an editor, IDLE simulates, as well as it can, the user entering 'python -i path' in a system command line shell.   Both on a command line and in IDLE, the program starts with sys.argv = ['path'] (at least on my Windows system).  This can be shown by running a file with 'import sys; print(sys.path)' both ways.

The request for this issue is to simulate 'python -i path a1, a2, ...'.
The program should start with sys.argv = ['path', 'a1', 'a2', '...'], with the argument strings being the same as they would be if entered at a command line on the *same system*.

I have looked at least a bit at all 4 patches and have decided to start fresh, using just a few existing lines.  The latest of the 4 was submitted 2 years ago, while I was learning to use git.

By the following September, using config-extensions was obsolete.  *If* we want to save a command string across sessions, a line could be added to config-main.  But I am dubious about this.  I expect that users will want to vary argument values for 1 program and need different sets of arguments for different programs.

I want to use a subclass of idlelib.query.Query for the query box.  No need to reinvent it.

I believe that argument strings should be parsed into an argument list using shlex.split.  No need to reinvent that either.  But I am not an expert in this area and the doc it rather vague.  I suspect that 'posix=False' should be used on Windows.  Does anyone know?  Gabriel's patch is the only one using shlex.split, but always with the default 'posix=True'.

Saimadhav tested his patch on Debian.  The others did not say.  A verified-by-human htest should be added to, and manual test running 'import sys; print(sys.argv)' from an editor done on the 3 major OSes.
Date User Action Args
2019-06-02 00:15:09terry.reedysetrecipients: + terry.reedy, rhettinger, ggenellina, gpolo, mcepl, mrabarnett, asvetlov, markroseman, wolma, Saimadhav.Heblikar, louielu, veganaiZe
2019-06-02 00:15:09terry.reedysetmessageid: <>
2019-06-02 00:15:09terry.reedylinkissue5680 messages
2019-06-02 00:15:08terry.reedycreate