New submission from Antoine Pitrou: After installing Django, I get the following error in test_pydoc:
====================================================================== FAIL: test_url_requests (test.test_pydoc.PydocUrlHandlerTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/antoine/cpython/finalize/Lib/test/test_pydoc.py", line 581, in test_url_requests self.assertEqual(result, title, text) AssertionError: 'Pydoc: Error - search?key=pydoc' != 'Pydoc: Search Results' - Pydoc: Error - search?key=pydoc + Pydoc: Search Results The reason is attempting to import a django.something module raises the following error: django.core.exceptions.ImproperlyConfigured: Requested setting DATABASES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings ... which isn't silenced by pydoc. Now I agree this is fundamentally obnoxious on Django's part, but unfortunately it isn't the only package (IIRC) to behave in this way, meaning it would be nice from pydoc to silence all such errors when an import is attempted. ---------- components: Library (Lib) messages: 189536 nosy: pitrou priority: normal severity: normal stage: needs patch status: open title: pydoc search chokes on import errors type: behavior versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18010> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com