[SciPy-user] "catching warnings"

A. M. Archibald peridot.faceted at gmail.com
Tue Sep 19 16:26:12 CDT 2006

On 19/09/06, Stefan van der Walt <stefan at sun.ac.za> wrote:

> You can change warnings into exceptions, afaik.  Take a look at the
> Python documentation on warning filters at

Unfortunately, they're not warnings at all, they're just print
statements - so not only can you not control them, they appear on
stdout (and not stderr), contaminating the output of your program.
This is far from the only module that does this, either (for example,
odepack.py. quadrature.py, optimize.py... grepping for "print" should
turn them up)

It would be nice if scipy provided some consistent way to signal
non-errors to the surrounding program. Would it work for all modules
to use warnings?

A. M. Archibald

More information about the SciPy-user mailing list