[GRASS-dev] Python and delayed or missing stderr output

Nikos Alexandris nik at nikosalexandris.net
Wed Sep 5 04:06:46 PDT 2018


* Markus Neteler <neteler at osgeo.org> [2018-09-05 10:43:23 +0200]:

>Hi,
>
>AFAIK Python buffers (i.e. effectively delays)  stderr output which is
>unhelpful in the GRASS GIS context.
>
>Searching for a solution, I found this reference: sys.stdout.flush()
>e.g.
>https://stackoverflow.com/questions/10019456/usage-of-sys-stdout-flush-method
>
>Would it be possible to add that to the GRASS GIS Python API?

And would this then make Python scripts, by default, to issue any print
statements (for debugging purposes or else) immediately?

I am unsure, but I think I see exactly this "problem" sometimes, when
scripting.  The order of what is requested to print out is sometimes mixed.

Thanks Markus.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20180905/3ed835be/attachment.sig>


More information about the grass-dev mailing list