[IPython-dev] stdout when running the test suite

MinRK benjaminrk at gmail.com
Sun Apr 24 22:22:48 EDT 2011


On Sun, Apr 24, 2011 at 17:16, Robert Kern <robert.kern at gmail.com> wrote:
> On 4/24/11 3:26 PM, MinRK wrote:
>> This has been true for a *long* time - at least January 2010.  I did
>> some checking, and it turns out that it's actually related to io.Term,
>> so I pushed a fix to PR #397, since that's regarding the same code.
>>
>> The Term object created with the InteractiveShell latches onto
>> sys.stdout before nose redirects it (which happens in every test), so
>> anything printed there would still arrive at stdout.  I've fixed this
>> in the tests, by creating simple StreamProxy objects that are soft
>> links to sys.stdout/err, rather than hard ones, so the Capture plugin
>> should still work with IPython output.
>
> For what it's worth, I've had to do a similar thing in a non-test situation. It
> might be worthwhile to expose such a thing in io itself.

Good to know.  For that matter, I'm not sure why we have
io.stdout/stderr (previously io.Term.cout/cerr) at all.
Under what circumstances do we want streams going to our stdout/stderr
to be handled *differently* from sys.stdout,stderr, or a logger?

-MinRK

>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless enigma
>  that is made terrible by our own mad attempt to interpret it as though it had
>  an underlying truth."
>   -- Umberto Eco
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>



More information about the IPython-dev mailing list