A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-June/066589.html below:

[Python-Dev] ImportWarning flood

[Python-Dev] ImportWarning floodRalf W. Grosse-Kunstleve rwgk at yahoo.com
Tue Jun 27 01:23:38 CEST 2006
--- "Delaney, Timothy (Tim)" <tdelaney at avaya.com> wrote:

> Michael Hudson wrote:
> 
> > Benji York <benji at benjiyork.com> writes:
> > 
> >> Nick Coghlan wrote:
> >>> Perhaps ImportWarning should default to being ignored, the same way
> >>> PendingDeprecationWarning does?
> >>> 
> >>> Then -Wd would become 'the one obvious way' to debug import problems
> >> 
> >> +1
> > 
> > I'm not sure what this would achieve -- people who don't know enough
> > about Python to add __init__.py files aren't going to know enough to
> > make suppressed-by-default warnings not suppressed.
> 
> The change was prompted by developers (specifically, Google developers).
> Developers should be able to put -Wd in their automated build scripts.
> 
> > The more I think about it, the more I like the idea of saying
> > something when an import fails only because of a missing __init__.py
> > file.  I guess I should try to implement it...
> 
> This is by far and away my preference as well (stating which directories
> may have been importable if they had __init__.py in the exception) but
> it was shot down in the original discussion.

I guess it is probably quite tricky to implement. Note the list of files with
the "No module named" message I posted earlier. Somehow you'd have to keep
track of all potential directories in all these different contexts.

I think a combination of pointing to the documentation and mentioning -Wd would
cover all situations. Most people just need a reminder. That's easy to achieve
with a new ImportErrorNoModule(name) exception.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4