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 cheryl.sabella, terry.reedy
Date 2019-03-26.03:09:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1553569758.24.0.333404497739.issue36429@roundup.psfhosted.org>
In-reply-to
Content
python -m idlelib.pyshell  # and
python f:/dev/3x/lib/idlelib/pyshell.py  # for instance
no longer start IDLE properly.  The separate subprocess startup command for when pyshell is the main, from 2004, is obsolete and no longer needed.  The command needed is the same as for when IDLE is started otherwise.  It works with either method of starting IDLE with pyshell.

In addition, two modules are created from pyshell.py, with names '__main__' and 'idlelib.pyshell'.  The attempt to prevent this should be at the top of the file instead of the bottem and now needs to add 'idlelib.pyshell' instead of 'pyshell'.  The test for this was to (temporarily) add 'print('running')' at the top of the file and see if 'running\n' is printed to the terminal once or twice.

An automated test might be done as follows:
1. Move imports in main(), including that of 'testing', to top of file.
2. Add, for instance, 'if testing: print('running') after the import.
3. Mock main().
4. Use test.support for 'with <captured stdout>: run pyshell.py'.
5. Check captured stdout for exactly one 'running' occurrence.
History
Date User Action Args
2019-03-26 03:09:18terry.reedysetrecipients: + terry.reedy, cheryl.sabella
2019-03-26 03:09:18terry.reedysetmessageid: <1553569758.24.0.333404497739.issue36429@roundup.psfhosted.org>
2019-03-26 03:09:18terry.reedylinkissue36429 messages
2019-03-26 03:09:17terry.reedycreate