stderr and stdout

Bernhard Herzog herzog at online.de
Thu Jun 29 13:31:32 EDT 2000


"Arinté" <shouldbe at message.com> writes:

> Oh I print stdout and err like so:
>    char *pix = PyString_AsString(temp);
>    Py_XDECREF(temp);
>    appcallback()->status(pix);
> where temp is either errorIO or stdIO.

You better swap the last two lines. pix points to memory owned by tmp
and it could be freed by the DECREF. Why XDECREF, btw? If tmp were NULL
PyString_AsString would segfault.

-- 
Bernhard Herzog   | Sketch, a drawing program for Unix
herzog at online.de  | http://sketch.sourceforge.net/



More information about the Python-list mailing list