[Python-Dev] ImportWarning flood

Jean-Paul Calderone exarkun at divmod.com
Fri Jun 30 21:43:31 CEST 2006

On Sun, 25 Jun 2006 17:51:17 -0700, Guido van Rossum <guido at python.org> wrote:
>On 6/24/06, Jean-Paul Calderone <exarkun at divmod.com> wrote:
>> >Actually, your application *was* pretty close to being broken a few
>> >weeks ago, when Guido wanted to drop the requirement that a package
>> >must contain an __init__ file. In that case, "import math" would have
>> >imported the directory, and given you an empty package.
>>But this change was *not* made, and afaict it is not going to be made.
>Correct. We'll stick with the warning. (At least until Py3k but most
>likely also in Py3k.)

Even given that it emits completely spurious warnings for any package that
happens to share a name with a directory in whatever the working path is
(say, your home directory)?

How about if someone grovels through import.c and figures out how to make
the warning information only show up if the import actually fails?


More information about the Python-Dev mailing list