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 John Isidore
Recipients John Isidore, barry, berker.peksag, ncoghlan, rhettinger, vstinner, yselivanov
Date 2014-09-29.10:40:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411987204.69.0.589167793411.issue22389@psf.upfronthosting.co.za>
In-reply-to
Content
There is stdout_redirected() function [1] that allows to redirect a file object given as `stdout` patameter including `sys.stderr`. It works at a file descriptor level i.e. it supports redirecting subprocess' output too but it doesn't work for StringIO (no fd).

[1] http://stackoverflow.com/questions/4675728/redirect-stdout-to-a-file-in-python/22434262#22434262
History
Date User Action Args
2014-09-29 10:40:04John Isidoresetrecipients: + John Isidore, barry, rhettinger, ncoghlan, vstinner, berker.peksag, yselivanov
2014-09-29 10:40:04John Isidoresetmessageid: <1411987204.69.0.589167793411.issue22389@psf.upfronthosting.co.za>
2014-09-29 10:40:04John Isidorelinkissue22389 messages
2014-09-29 10:40:04John Isidorecreate