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 dmi.baranov
Recipients dmi.baranov, docs@python, fdrake, serhiy.storchaka
Date 2013-05-27.18:51:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1369680671.3.0.744855248142.issue17987@psf.upfronthosting.co.za>
In-reply-to
Content
Yes, I agree that this is not an obvious sample, but:

$ ./python -m test.test_support | grep test_captured_stdin
test_captured_stdin (__main__.TestSupport) ... ok

What's about that?

with captured_stdin() as s:
    s.write('hello\n')
    s.seek(0)
    captured = input()

assert captured == 'hello'
History
Date User Action Args
2013-05-27 18:51:11dmi.baranovsetrecipients: + dmi.baranov, fdrake, docs@python, serhiy.storchaka
2013-05-27 18:51:11dmi.baranovsetmessageid: <1369680671.3.0.744855248142.issue17987@psf.upfronthosting.co.za>
2013-05-27 18:51:11dmi.baranovlinkissue17987 messages
2013-05-27 18:51:11dmi.baranovcreate