[Python-Dev] ImportWarning flood

"Martin v. Löwis" martin at v.loewis.de
Sat Jun 24 09:36:29 CEST 2006

Ralf W. Grosse-Kunstleve wrote:
>> This has nothing to do with beta1; the warnings module was introduced
>> many releases ago, along with all the mechanics to disable warnings.
> Due to the new ImportWarning first introduced in 2.5b1 the question of
> disabling warnings is becoming much more pressing (I am assuming that I am not
> again the only person on the planet to have this problem).

Sure. However, many people on comp.lang.python could have told you how
to silence warnings in Python.

> Where would I put the warnings.simplefilter()? I have hundreds of scripts and
> __init__.py files.

I would have to study your application to answer that question. Putting
it into sitecustomize.py should always work.

> I.e. I get the ImportWarning just because my current working directory happens
> to contain a subdirectory which matches one of the Python modules in the
> standard library. Isn't this going to cause widespread problems?

I don't know. Whether a warning is a problem is a matter of attitude, also.


More information about the Python-Dev mailing list