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 serhiy.storchaka, terry.reedy
Date 2017-10-22.18:25:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1508696760.31.0.213398074469.issue31836@psf.upfronthosting.co.za>
In-reply-to
Content
On the PR, Serhiy asks "Wouldn't be better to restore sys.ps1 in test_idle if it is changed here?"

Aside from the fact that, as far as I know, it is not sanely possible to do so, I think it a bug for a test to be unnecessarily fragile.  Both ps1 and ps2 are set when Python is in interactive mode.  IDLE is only (partially) imitating Python's shell when it sets sys.ps1.

The premise of #25588 is that tests should accommodate sys.stdout and sys.stderr being None to the extent possible.  I think the same applies to sys.ps1/2 being set.  Indeed, as I reported on #31761, in msg304298, 9 days ago, test_code_module tests test_ps1 and test_ps2 failed when I ran '>>> import test.autotest' in a *Python* shell.  I did not understand the reason for the failures then, but if I had investigated, I should hope that I would have submitted the same PR, which fixes this autotest failure.
History
Date User Action Args
2017-10-22 18:26:00terry.reedysetrecipients: + terry.reedy, serhiy.storchaka
2017-10-22 18:26:00terry.reedysetmessageid: <1508696760.31.0.213398074469.issue31836@psf.upfronthosting.co.za>
2017-10-22 18:26:00terry.reedylinkissue31836 messages
2017-10-22 18:25:59terry.reedycreate